Telerik Forums
Kendo UI for jQuery Forum
3 answers
273 views
Here is an example:

  @(Html.Kendo().Grid<MyViewModel>(Model.Records)
            .Name("MyGrid")
            .Columns(columns =>
            {               
                columns.Bound(c => c.Price)
                    .HtmlAttributes(new { @class = "gridColumnPrice" })
                    .Title(UIResources.Price)
                    .HeaderHtmlAttributes(new { @class = "gridColumnPrice" });
           })
            .DataSource(c => c.Server()
            )

This code generates JS as below:

jQuery(function(){jQuery("#MyGrid").kendoGrid({columns:[{title:"Price",attributes:{class:"gridColumnPrice"}, ............... ETC

In IE8 and older versions, you will get:
SCRIPT1028: Expected identifier, string or number lyKqsEz1h0Lo7AitxGa6wik1, line 2 character 208

This is because 'class' word in JS is not allowed as class property. You should add apostrophes around properties.
AspenSquare
Top achievements
Rank 1
 answered on 14 Nov 2012
3 answers
602 views
Hi There, i cannot get the datasource to work. Specifically the issue is passing the GET parameter. The only way i've gotten the read to work is to place the paramter directly in the READ URL:


$(document).ready(function () {
            var dsCategories = new kendo.data.DataSource({
                transport: {
                    read: "/CostDriver/GetCostDriverCategoriesByRegion/" + $("input[name='region']:checked").val() ,
            ...

The issue is, on the click of radio button from where this value is coming from, the read uses the ORIGINAL value from the radiobuttongroup from when the page initially loads. Onclick of this radiobuttongroup calls the datasource read but the new value is NEVER sent.

HOW HOW HOW do you properly use the DATA property in the transport? I have tried everything and it does not work.

$(document).ready(function () {
            var dsCategories = new kendo.data.DataSource({
                transport: {
                    read: "/CostDriver/GetCostDriverCategoriesByRegion/",
                    data: { "regionId": $("input[name='region']:checked").val() }
                }
            });
            $("#selectCategory").width(180).kendoComboBox({
                dataTextField: "CostDriverCategoryName",
                dataValueField: "CostDriverCategoryId",
                dataSource: dsCategories
            });

            $("#selectCommodity").width(180).kendoComboBox({ enabled: false });

            $("input[name='region']").click(function () {
                alert($("input[name='region']:checked").val());
                dsCategories.read();
            });
        });
Daniel Cuba
Top achievements
Rank 1
 answered on 14 Nov 2012
0 answers
220 views
Hey guys,

I'm relatively new to Kendo UI and just had a question about filtering a grid by using values from a combobox. From my understanding I can do something like this:

@(Html.Kendo().ComboBox()
                .Name("combobox name")
                .Events(e=>e.Change(@<text>
                                     function(e) {
                                        var grid = $("#Grid").data("kendoGrid");
                                        var value = this.value();
                                        if(value) {
                                                grid.dataSource.filter({ field: "filter field", operator: "eq", value: parseInt(value) });
                                               }
                                        else{
                                                grid.dataSource.filter({});
                                            }
                                        }
                                     </text>
                    )
                  )
                .Placeholder("Place holder..")
                .DataTextField("Text")
                .DataValueField("Value")
                .DataSource(source => {
                    source.Read(read => 
                    {
                        read.Action("Controller Action", "Controller");
                    });
                })
                .SelectedIndex(0)

I've tried this and leads it filters my grid with my desired results, but if I go about it this way and try to add a new item, the item is then added to the unfiltered page of the grid (which is not desirable). From a few other posts I have read, I found I could navigate around this issue simply by adding a few things to to the filter command, like so:

   grid.dataSource.filter({logic: "or", filters[{ field: "filter field", operator: "eq", value: parseInt(value) }, { field: "filter field", operator: "eq", value: 0 }]})

Having that allows me to, when I click add a new item, to have that item show up on the filtered page of the grid. However, I am then unable to save that newly created instance. I wonder is there another way of filtering a grid using a combobox? If there is, any help/ advice would be really helpful.

                           Thanks,
                                          Chris
Chris
Top achievements
Rank 1
 asked on 14 Nov 2012
0 answers
155 views
Hi,

I'm creating donut charts and setting the title like this:

$("#" + divName).kendoChart({
   title: {
      text: "my title"
   },
My problem is that the series title comes from the json object I use to populate the chart.

Is it possible to set the chart title using the same binding feature of the one in the series object? (categoryField, field, colorField, etc...).
Something like:
$("#" + divName).kendoChart({
   title: {
      textField: "fieldWithTitle"
   },
Thanks,

André

Andre
Top achievements
Rank 1
 asked on 14 Nov 2012
1 answer
102 views
Does the KendoUI mobile work on Android ?
Which minimal version / device vendor is required ?

From cheap android version 4.0.3 it won't work.

Taps not working, scrolls not working. Loading page
gives terrible white screen on few tiny moments enough
to see it.

Tried several examples from local network and latest
download. Then from your site. Effect is the same.

The framwork looks promising from the browser
but first attempt from a real devices was terrible.

Thanks.
Iliana Dyankova
Telerik team
 answered on 14 Nov 2012
5 answers
522 views
Hi, I'm looking at the "binding to local source" treeview demo below and was wondering how do you structure this AND the schema to allow 3+ levels of "subCategeries" for something like a parts list.  I'm playing with local data but want to eventually populate from remote data and with the list initially expanded.  

Once I find this out,  I want to use that format to build the JSON response sent from the service.  Thanks.

var inline = new kendo.data.HierarchicalDataSource({
data: [
{ categoryName: "Storage", subCategories: [
{ subCategoryName: "Wall Shelving" },
{ subCategoryName: "Floor Shelving" },
{ subCategoryName: "Kids Storage" }
] },
{ categoryName: "Lights", subCategories: [
{ subCategoryName: "Ceiling" },
{ subCategoryName: "Table" },
{ subCategoryName: "Floor" }
] }
],
schema: {
model: {
children: "subCategories"
}
}
});

$("#treeview-right").kendoTreeView({
dataSource: inline,
dataTextField: [ "categoryName", "subCategoryName" ]
});
OnaBai
Top achievements
Rank 2
 answered on 14 Nov 2012
0 answers
111 views
Hi,

I'm looking to change the dimensions of the TabStrip, specifically on Android.

Any help would be great
Charlie
Top achievements
Rank 1
 asked on 14 Nov 2012
3 answers
708 views
Hello I am using Kendo UI Treeview and loading the nodes dynamically from a Json Data source.The nodes are getting loaded correctly, but when i expand a node it is calling the webapi, if it does not have any child nodes it is not suppose to show the arrow, but it is. Can anybody help me suggest some solution?

Thanks
Mike Rybnikov
Top achievements
Rank 1
 answered on 14 Nov 2012
1 answer
126 views
Hi,

when I use a template to specify the layout of a cell within a grid, the filter icon is not displayed anymore (see red square in comparison to the green one in my image).

What do I have to do that it shows up again?

Thanks
Florian

Florian
Top achievements
Rank 1
 answered on 14 Nov 2012
5 answers
407 views
Hi,

I'm having a problem with at least one of the demos when using the latest normal version of chrome -- http://demos.kendoui.com/web/dropdownlist/index.html

When I click the dropdown it shows the list of cap colors, but when I select one it doesn't work. It works fine in IE and firefox.  I'm also having problems with this in my application (thus why I looked at the demos).  Should I file this as a bug somewhere with you?

Thanks,
se
Georgi Krustev
Telerik team
 answered on 14 Nov 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?