Telerik Forums
Kendo UI for jQuery Forum
2 answers
256 views
I am testing a REST call from my server to load a Data Source, and my REST service returns the JSON data like this:

{"person":[{"address":"Address1","name":"Person1"},{"address":"Address2","name":"Person2"},{"address":"Address3","name":"Person3"}]}

This has been okay for some other frameworks I'm testing, with the use of a "root" setting that tells the datasource to grab the JSON object that is "person".

Here is my Kendo code:

$(document).ready(function() {
 
   $("#grid").kendoGrid({
      dataSource: {
         transport: {
            read: {
               url: myURLFunc(),
               dataType: "json"
            }
         },
         schema: {
            model: {
               fields: {
                  name: {},
                  address: {}
               }
          }
      }
   },
   height: 250,
   sortable: true,
   columns: [
      {
         field: "name",
         title: "Person"
      },
      {
         field: "address",
         title: "Address"
      }
      ]
   });
});

Is there anything I can do differently to have the Kendo Data Source load the JSON I currently have?
Zach
Top achievements
Rank 1
 answered on 11 Apr 2012
3 answers
181 views
I find that the following code is causing script errors:

        $("#my-k-grid").kendoGrid({
            dataSource: {
                data: mydata
            },
            change: onMyRowSelected,
            selectable: "multiple, row",
            pageable: false,
            scrollable: true,
            navigatable: true,
            columns: mycols
        });

If I trap the exception, I get a TypeError: "Object doesn't support this action"

If i comment out the use of the selectable option, I don't get an error, however cells are selectable and I would prefer multiple row selection.

I am using the 2012Q1 build.  Everything was previously working correctly using the 2011Q3 build.

EDIT: I am trying to use the kendo chart elsewhere on my page.  Therefore I have the following included in addition to kendo.web.min.js:
kendo.core.min.js
kendo.data.odata.min.js
kendo.data.xml.min.js
kendo.data.min.js
kendo.dataviz.core.min.js
kendo.dataviz.vml.min.js
kendo.dataviz.svg.min.js
kendo.dataviz.chart.min.js

If I remove these script includes, I do not get the 'selectable' error however my chart doesn't load.

Previously When I was on 2011Q3 I would just include kendo.all.min.js but that is not available to me anymore.
Mike
Top achievements
Rank 1
 answered on 11 Apr 2012
1 answer
132 views

When creating a listview without specifying a template (ok, not very real situation, but still....) you get an error

In this lines:

that.template = kendo.template(options.template || "");
that.altTemplate = kendo.template(options.altTemplate || options.template);

 

The second line should be:

that.altTemplate = kendo.template(options.altTemplate || options.template || "");

Regards, Jaap

Nikolay Rusev
Telerik team
 answered on 11 Apr 2012
9 answers
431 views

If I load en-GB, I get a mixed current culture.

<script src="/components/com_hellokendo/js/jquery.min.js" type="text/javascript">
</script> <script src="/components/com_hellokendo/js/kendo.all.min.js" type="text/javascript"></script> <script src="/components/com_hellokendo/js/cultures/kendo.culture.en-GB.min.js" type="text/javascript"></script>
<script type="text/javascript">
kendo.culture("en-GB");
</script>

cultures.current Object { name="en-GB" ... calendars ... patternsObject { d="dd/MM/yyyy" WRONG

Which is the problem?, it seems to be loading the second culture or my browser localization.

Thanks,
Anibal
T3DdYBeR57
Top achievements
Rank 1
 answered on 11 Apr 2012
1 answer
350 views
Hi everybody!
I'm facing a problem on my grid (Kendo Web + PHP + MySQL).

Here's the sittuation:
I'm using a popup editing grid, and almost everything is going well, apart from the "delete" function. If i save a new record, and try to delete it without close the grid, is doesn't happen on my MySQL DB, only on the grid, because when i save, the ID remains as "null" (as ID is a Auto_increment field) on the grid.
Is there anything wrong on my code, or is there anything missing to refresh the ID ( I mean right after i save, it should get the ID from the db).

Please could someone help me?

Thanks in advance.


here's the code on JsFlddle
http://jsfiddle.net/63sCD/4/ 
Rosen
Telerik team
 answered on 11 Apr 2012
1 answer
272 views
Hi,
MVC + kendo
when i select the value from ddl the first chart get data in perfect way
but when i use the chart event its give me error in js 

please any advice  
 
thanks
omar

 <div id="example" >
             <label for="Mun">Mun:</label>
                <input id="Mun"/>
            <div class="chart-wrapper">
            <div id="chart"></div>
            <div id="BarChart"></div> 


            </div>
            <script>

                var transport = {
                    read: {
                        url: "@Url.Action("Read", "Plot")", 
                         type: "POST" 
                    }
                };
                var Muntransport = {
                    read: {
                        url: "@Url.Action("ReadMun", "Plot")", 
                         type: "POST" 
                    }
                };


                     var ReadByLandUsetransport = {
                    read: {
                        url: "@Url.Action("ReadByLandUse", "Plot")", 
                         type: "POST" 
                    }
                };




              
              
                   var PlotByLandUseDataSource = new kendo.data.DataSource({
                    transport: ReadByLandUsetransport                                    
                         
                });
              


                var MunDataSource = new kendo.data.DataSource({
                    transport: Muntransport,
                    sort: {
                        field: "MUNICIPALITYNAME_E",
                        dir: "asc"
                    }
                });
                var PlotDataSource = new kendo.data.DataSource({
                        transport: transport
                         
                    });


                function filterMun() {
                   var dropdownlist = $("#Mun").data("kendoDropDownList");
                   var value = dropdownlist.value();
                     PlotDataSource.filter([
                    
                    {field: "MUNICIPALITYNAME_E",operator: "equals", value:value}
                    
                    ]);
                } 


                   function filterLandUse(e) {
                   PlotByLandUseDataSource.filter([
                    
                    {field: "MAIN_LANDUSE_E",operator: "equals", value:e.category}
                    
                    ]);

                }

         
                      function createChart() {
                      
                        $("#chart").kendoChart({
                        theme: $(document).data("kendoSkin") || "metro",
                        dataSource: PlotDataSource,
                        autoBind: false,                  
                        title: {
                            text: "Elms Application Count Per municibality! "
                        },
                        legend: {
                            position:"bottom"
                        },
                        seriesDefaults: {
                          labels: {
                                visible: true,
                                 format: "{0:N0}"
                            }
                           
                        },
                        series: [{
                            type: "pie",
                            field: "PLOTCOUNTS",
                            categoryField: "MAIN_LANDUSE_E"
                        }],
                        tooltip: {
                            visible: true,
                            format: "{0:No}"
                        },
                        seriesClick: filterLandUse


                    });
                    }


                    function createSubLanduseChart() {
                      
                        $("#Barchart").kendoChart({
                        theme: $(document).data("kendoSkin") || "Metro",
                        dataSource: PlotByLandUseDataSource,
                        autoBind: false,                  
                        title: {
                            text: "Elms Sub Land use! "
                        },
                        legend: {
                            position:"bottom"
                        },
                        seriesDefaults: {
                          labels: {
                                visible: true,
                                 format: "{0:N0}"
                            }
                           
                        },
                        series: [{
                            type: "column",
                            field: "AREAGROUP",
                            categoryField: "SUB_LANDUSE_E"
                        }],
                        tooltip: {
                            visible: true,
                            format: "{0:No}"
                        }


                    });
                    }





                $(document).ready(function() {
                    $("#Mun")
                    .val("Abu Dhabi")
                    .kendoDropDownList({
                            dataSource: MunDataSource,
                            dataTextField: "MUNICIPALITYNAME_E",
                            dataValueField: "MUNICIPALITYNAME_E",
                            change: filterMun
                        });


                 createChart();
                    createBChart();
                    filterMun();                  
  
                       $("#example").bind("kendo:skinChange", function(e) {
                        createChart();
                        createBChart();
                        // 
                        plotDataSource.read();
                        PlotByLandUseDataSource.read();
        
                    });

                });
               </script>
        </div>
Iliana Dyankova
Telerik team
 answered on 11 Apr 2012
3 answers
246 views
Hello,

I am trying to create an editable grid, whose dataSource contains fields with empty strings, which should then be set by the user. However, the Kendo Grid does not seem to support editing of cells whose content is empty.

You can try it out on jsFiddle
Is this a known issue, and how can I bypass it?

Thanks,
Szilard
Alexander Valchev
Telerik team
 answered on 11 Apr 2012
3 answers
782 views
Hi,
first, im sorry for my bad english.

I have grid, and i have window, which via ajax insert into db new row, close itself, and try refresh grid in ajax succes function. Close is sucessfull, but grid reload doesnt do anything :(

I try button with onclick="ted()" and function is: 


function ted() {
var grid = $("#grid_clients").data("kendoGrid")
grid.refresh();
}


But refresh doesnt working still.. please can u tell me, what is wrong?
Dimo
Telerik team
 answered on 11 Apr 2012
1 answer
347 views
Code:

var datasourceBrokers = new kendo.data.DataSource({
                        
                        transport: {
                            read: {
                                url: "@Url.Action("GetBrokersFromEvent", "Allianz")" + "?id=" +  $("#input").data("kendoComboBox").value(),
                                type: "POST"
                             },
                            update: {
                                url:"@Url.Action("SaveBroker", "Allianz")",
                                type: "POST"
                            },
                            parameterMap: function (data, operation) {
            
                                    if (operation != "read") {
               
                                        var result = {};

                                        for (var i = 0; i < data.models.length; i++) {
                                            var broker = data.models[i];

                                            for (var member in broker) {
                                                result["broker[" + i + "]." + member] = broker[member];
                                            }
                                        }
                                        
                                        return result;
                                    }

                                }
                        },
                        batch: true,
                        schema: {
                            model: {
                                id: "ID",
                                fields: {
                                    ID: { editable: false, nullable: false },
                                    Titlecode: { editable: false, nullable: true },
                                    FirstName: { editable: false, nullable: true },
                                    LastName: { editable: false, nullable: true },
                                    Email: { editable: false, nullable: true },
                                    Businessphone: { editable: false, nullable: true },
                                    Mobilephone: { editable: false, nullable: true },
                                    Language: { editable: false, nullable: true },
                                    EventId: { editable: false, nullable: true },
                                    FirmaId: { editable: false, nullable: true },
                                    Registered: { editable: false, nullable: true },
                                    ImportLabel: { editable: false, nullable: true },
                                    FirmaCustomerID: { editable: false, nullable: true },
                                    LanguageCode: { editable: false, nullable: true },
                                    ParentCustomer: { editable: false, nullable: true },
                                    AllianzContactId: { editable: false, nullable: true },
                                    AccountId: { editable: false, nullable: true },
                                    SegmentationParentCustomer: { editable: false, nullable: true },
                                    NoofEmployeesParentCustomer: { editable: true, nullable: true },
                                    ContactId: { editable: false, nullable: true },
                                    NordSud: { editable: false, nullable: true },
                                    Acmaad: { editable: false, nullable: true },
                                    Acmavi: { editable: false, nullable: true },
                                    ContacManager: { editable: true, nullable: true },
                                    OverFlow12: { editable: true, nullable: true },
                                    OverFlow13: { editable: false, nullable: true },
                                    OverFlow14: { editable: false, nullable: true },
                                    OverFlow15: { editable: false, nullable: true }
                                }
                            }
                        }
                      
                    });
                    
                    $("<div/>").appendTo(e.detailCell).kendoGrid({
                        dataSource: datasourceBrokers,
                        scrollable: false,
                        sortable: true,
                        pageable: true,
                        editable: true,
                        toolbar: ["save", "cancel"],
                        columns: [
                        { field: "ParentCustomer", title: "Broker" },
                        { field: "FirstName", title: "First Name" },
                        { field: "LastName", title: "Last Name" },
                        { field: "SegmentationParentCustomer", title: "Segmentation" },
                        { field: "ContacManager", title: "Invited by" },
                        { field: "OverFlow12", title: "Status" }
                    ]
                    });
                }
            }

Error (after changes in the grid, and update clicked):in  kendo.web.min.js:
a is undefined

The code in parameterMap gives the right objects.


Sven
Top achievements
Rank 2
 answered on 11 Apr 2012
0 answers
175 views
Hello,
I'm facing a problem with the dropdownlist :

Hello,

I just want to click on a specific item in the list, on my local machine the following code works perfectly :
 public static void ClickScrollableControl( HtmlDiv uIPointsList, User accessPoint)
{
   HtmlCell uICell = uIPointsList.GetControl<HtmlCell>(HtmlControl.PropertyNames.InnerText, accessPoint.Name)
Mouse.Click(uICell);
}

the playback engine scroll till the cell is visible, and it click on it.

When running the same code on the TestAgent (log automatically), the scrolling doesn't work.

My question is just how to scroll manually. I've tried this code but without success :

 public static void ClickScrollableControl( HtmlDiv uIPointsList, User accessPoint)
{
   HtmlCell uICell = uIPointsList.GetControl<HtmlCell>(HtmlControl.PropertyNames.InnerText, accessPoint.Name)
Mouse.Click(uICell);
Rectangle uICellRectangle = uICell.BoundingRectangle;

Rectangle uIPointsListRectanle = uIPointsListRectangle.BoundingRectangle;

int wheel = 1;
 while (!uIPointsListRectangle.Contains(uICellRectangle))
 {
     Mouse.MoveScrollWheel(wheel);
     wheel = wheel + 1;
          
     HtmlCell uICell = uIPointsList.GetControl<HtmlCell>(HtmlControl.PropertyNames.InnerText, accessPoint.Name)

    Rectangle uICellRectangle = uICell.BoundingRectangle;
  }

Mouse.Click(uICell);
}

it doesn't scroll at all !!!, any idea ?
issamo
Top achievements
Rank 1
 asked on 11 Apr 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
ListBox
DropDownTree
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
PivotGridV2
Licensing
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
+? 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?