Telerik Forums
Kendo UI for jQuery Forum
4 answers
1.0K+ views
Another question for you lovely Kendo people!

I'm currently struggling to bind more than one function to a Grid, my code is:

<div id="grid" data-role="grid" data-bind="source: gridSource"></div>

Which works fine, but I want this Grid to be a multi-selectable Grid (my own Kendo extension) and can't seem to bind this when I try:

<div id="grid" data-role="grid" data-bind="source: gridSource, selectableGrid: selectOptions"></div>

The error displays as "selectableGrid" is not supported by "div" or something along those lines. However, if I try and just use the selectableGrid without the source binding, then it works fine.

Any suggestions, or will this be fixed in a future release?
Chris
Top achievements
Rank 1
 answered on 30 Mar 2012
2 answers
127 views
Hi,

I'm having troubles trying to update a chart: http://jsfiddle.net/luisk/aHFwc/

I'm using chart.dataSource.data(prb);

As you can see in the example, the title is changing but the data source is not.

Thanks!
Luis Carlos
Top achievements
Rank 2
 answered on 30 Mar 2012
0 answers
124 views
Hi!

I am unable to retrieve the e.data.id because events from detailExpand is undefined. For detailInit, it's okay. Do you know why? Is there a bug or is this written in this way?

                detailInit: function(e) {
                            console.log(e.data.id);
                },
                detailExpand: function(e) {
                             console.log(e.data.id);
                 },   
George
Top achievements
Rank 1
 asked on 30 Mar 2012
1 answer
128 views
I would like to display a model window in response to a user clicking on an Axis title of a chart that plot time series data.  This modal window would allow the user to adjust some of our chart settings (Xaxis: time period) and (Yaxis: engineering units of measure).  I have looked through the forums and documentation but cannot seem to find an event.

Thanks
Paul
Iliana Dyankova
Telerik team
 answered on 30 Mar 2012
1 answer
156 views
Hi,

Can anyone tell me how to retrieve the original object that was bound to the grid when a row is selected.
I attached the following callback to the "change" property of  grid.  I assume there is a way to fetch the original JSON object from this "arg" parameter.

function onChange(arg) {                
                .... Need to retrieve the object that was bound to the selected row.
                });

Thanks in advance.
Mohamed
Top achievements
Rank 1
 answered on 30 Mar 2012
1 answer
185 views
Do you have any plans for canvas based visualization components? 

Infragistics is demoing html5 canvas based charts with 500,000 data points where you can zoom in on specific points.  Just wondering if a similar story exists for SVG, performance wise does this translate?  Did you do any published analysis on this?

In the past, the recommended LOB path would have been a plugin (silverlight) to show this amount of data.  Now that this is available with a canvas it is tempting for LOB applications.

T. Tsonev
Telerik team
 answered on 30 Mar 2012
3 answers
1.5K+ views
Hello,

Before the new release, if i wanted to get the JSON object model in a data source, i did :
JSON.stringify(myGrid.dataSource.data());
But now, in the JSON string i have also a "_events" node inside it.

So, how can i get real data ?

Here the jsFiddle : http://jsfiddle.net/eyAkP/13/ 

Best Regards,
Guillaume


Valanto
Top achievements
Rank 1
 answered on 30 Mar 2012
8 answers
354 views
 I have the latest version of KendoComplete, and a grid that I have enabled grouping with a remote data source
I can group, but the arrow switch at the left of the group is missing, which means I cannot expand or
collapse the group. (this happens no matter what theme I choose).


I also have selectable enabled (by full row) with multiple items, and I would like to be able to press
the group heading and select the entire group at once. Any ideas?

                  $
("#grid").kendoGrid({
                        dataSource
: myRemoteData,
                        groupable
: true,
                        scrollable
: true,
                        sortable
: true,
                        pageable
: true,
selectable: "multiple, row",
...


Iliana Dyankova
Telerik team
 answered on 30 Mar 2012
1 answer
513 views
Hi,

I'm trying to get Server Aggregates working on my grid and I can't seem to get them to show up.  Server grouping, sorting, and filtering are all working until I return the aggregates and then the grid no longer renders the data.  

There seems to be an issue in writing the group footer.  I get the error on the call to that.groupFooterTemplate(group.aggregates) inside the grid's _groupRoiwHtml function: "Uncaught ReferenceError: sum is not defined".  I assume its either my groupFooterTemplate configuration or the actual aggregates I'm returning, but I can't figure it out.

Once I've got this working I'd also like to get the grid footer aggregates working, but I'm not sure where those are getting pulled from either. 

I've put some of the relevant configuration below:

DataSource.schema.model
{
   "fields": {
     "TestContacts_ID": {
       "editable": false,
       "nullable": true,
       "type": "string"
     },
     "TestContacts_CompanyName": {
       "editable": false,
       "nullable": true,
       "type": "string"
     }
   }
 }

DataSource.group
[
  {
    "field": "TestContacts_CompanyName",
    "dir": null,
    "aggregates": [
      {
        "field": "TestContacts_ID",
        "aggregate": "sum"
      }
    ]
  },
  {
    "field": "TestContacts_ID",
    "dir": null,
    "aggregates": [
      {
        "field": "TestContacts_ID",
        "aggregate": "sum"
      }
    ]
  }
]

DataSource.aggregate
[
  {
    "field": "TestContacts_ID",
    "aggregate": "sum"
  }
]

Grid.columns
[
   {
     "field": "TestContacts_ID",
     "title": "ID",
     "width": 75,
     "format": null,
     "template": null,
     "aggregates": [
       "sum"
     ],
     "groupHeaderTemplate": "ID: #= value #",
     "groupFooterTemplate": "Sum:#= sum #"
   },
   {
     "field": "TestContacts_CompanyName",
     "title": "CompanyName",
     "width": 200,
     "format": null,
     "template": null,
     "aggregates": null,
     "groupHeaderTemplate": "CompanyName: #= value #",
     "groupFooterTemplate": ""
   }
 ]

DataSource.schema.groups gets set to this:
[
    {
      "aggregates": {
        "TestContacts_ID": 78.0
      },
      "field": "TestContacts_CompanyName",
      "value": "MC 1",
      "hasSubgroups": true,
      "items": [
        {
          "aggregates": {
            "TestContacts_ID": 25.0
          },
          "field": "TestContacts_ID",
          "value": "25",
          "hasSubgroups": false,
          "items": [
            {
              "TestContacts_ID": "25",
              "TestContacts_CompanyName": "MC 1"
            }
          ]
        },
        {
          "aggregates": {
            "TestContacts_ID": 26.0
          },
          "field": "TestContacts_ID",
          "value": "26",
          "hasSubgroups": false,
          "items": [
            {
              "TestContacts_ID": "26",
              "TestContacts_CompanyName": "MC 1"
            }
          ]
        },
        {
          "aggregates": {
            "TestContacts_ID": 27.0
          },
          "field": "TestContacts_ID",
          "value": "27",
          "hasSubgroups": false,
          "items": [
            {
              "TestContacts_ID": "27",
              "TestContacts_CompanyName": "MC 1"
            }
          ]
        }
      ]
    },
    {
      "aggregates": {
        "TestContacts_ID": 57.0
      },
      "field": "TestContacts_CompanyName",
      "value": "MC 2",
      "hasSubgroups": true,
      "items": [
        {
          "aggregates": {
            "TestContacts_ID": 28.0
          },
          "field": "TestContacts_ID",
          "value": "28",
          "hasSubgroups": false,
          "items": [
            {
              "TestContacts_ID": "28",
              "TestContacts_CompanyName": "MC 2"
            }
          ]
        },
        {
          "aggregates": {
            "TestContacts_ID": 29.0
          },
          "field": "TestContacts_ID",
          "value": "29",
          "hasSubgroups": false,
          "items": [
            {
              "TestContacts_ID": "29",
              "TestContacts_CompanyName": "MC 2"
            }
          ]
        }
      ]
    }
  ]

Also, it would be awesome to have a sample out there that showed how to implement server-side everything (sort,filter,group,aggregates) so one could get an idea what the setup would look like...

Thanks!
Matt
Rosen
Telerik team
 answered on 30 Mar 2012
1 answer
260 views
Hi
i tries to use popup editing using the asp.net examples https://github.com/telerik/kendo-examples-asp-net

by changing the editor option to "popup" but it does not response and continue use inline editing

and also when i try to create new on using the below code it doesn't work


script code  
$(document).ready(function () {
 
 
 
    $("#mygrid").kendoGrid({
        dataSource: {
            schema: {
                data: 'd',
                model: {
                    id: "Id",
                    fields: {
                        Id: { type: "number" },
                        FirstName: { type: "string" },
                        LastName: { type: "string" },
                        City: { type: "string" },
                        BirthDate: { type: "date" }
                    }
                }
            },
            transport: {
                create: {
                    url: "../Webservices/KendoService.asmx/CreateAds", //specify the URL which should create new records. This is the Create method of the Products.asmx service.
                    contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                    type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
                },
                read: {
                    url: "../Webservices/KendoService.asmx/ReadAds", //specify the URL which data should return the records. This is the Read method of the Products.asmx service.
                    contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                    type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
                },
                update: {
                    url: "../Webservices/KendoService.asmx/UpdateAds", //specify the URL from which should update the records. This is the Update method of the Products.asmx service.
                    contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                    type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
                },
                destroy: {
                    url: "../Webservices/KendoService.asmx/DestroyAds", //specify the URL which should destroy records. This is the Destroy method of the Products.asmx service.
                    contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                    type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
                },
                parameterMap: function (data, operation) {
                    if (operation != "read") {
                        // web service method parameters need to be send as JSON. The Create, Update and Destroy methods have a "products" parameter.
                        return JSON.stringify({ products: data.models })
                    }
                }
            },
            pageSize: 10
        },
        pageable: true,
        height: 400,
        toolbar: ["create"],
        columns: [
        { field: "Id", width: "60px" },
        { field: "FirstName", title: "First Name" },
        { field: "LastName", title: "Last Name" },
        { field: "City" },
        { field: "BirthDate", template: '#= kendo.toString(BirthDate,"MM/dd/yyyy") #' },
        { command: [
                { name: "edit", text: "CustomEdit" }, // sets the text of the Edit button
                {name: "destroy", text: "Destroy"} // sets the text of the "Delete" button
            ],
            // sets the title and the width of the commands column
            title: " ",
            width: "300px"
        }
    ],
        editable: "popup",
        //changes the text of the "Update" and "Cancel" buttons in the inline edit mode
        edit: function () {
            var updateBtnTxt = "CustomUpdate",
            cancelBtnTxt = "CustomCancel",
            curr_container = this._editContainer; //selects the current edit container
 
            //sets the text of the "Update" button
            $(curr_container).find("a.k-grid-update").text(updateBtnTxt);
            //sets the text of the "Cancel" button
            $(curr_container).find("a.k-grid-cancel").text(cancelBtnTxt);
        }
    });
 
 
});

web service code

    /// <summary>
    /// Creates new products by inserting the data posted by the Kendo Grid in the database.
    /// </summary>
    /// <param name="products">The products created by the user.</param>
    /// <returns>The inserted products so the Kendo Grid is aware of the database generated ProductID</returns>
    [WebMethod]
    public IEnumerable<TempJson> CreateAds(IEnumerable<TempJson> products)
    {
        var result = new List<JobHistory>();
 
        JobHistoryDB sdb = new JobHistoryDB();
        JobHistoryCollection myCollection = new JobHistoryCollection();
        List<TempJson> returned = new List<TempJson>();
        foreach (TempJson j in products)
        {
            JobHistory my = new JobHistory();
            my.Approved = true;
            my.CompanyID = 1;
            my.CompanyName = "";
            my.End = DateTime.Parse(j.BirthDate);
            my.Start = DateTime.Parse(j.BirthDate);
            my.JobTitle = j.FirstName;
 
            myCollection.Add(my);
        }
 
        sdb.Insert(myCollection);
        if (sdb.Insert(myCollection) > 0)
        {
 
            foreach (JobHistory j in myCollection)
            {
                TempJson mj = new TempJson();
                mj.Id = j.JobHistoryID;
                mj.FirstName = j.JobTitle;
                mj.LastName = j.CompanyName;
                mj.BirthDate = j.Start.ToShortDateString();
 
                returned.Add(mj);
            }
        }
        return returned;
 
 
    }
 
    /// <summary>
    /// Reads the available products to provide data for the Kendo Grid
    /// </summary>
    /// <returns>All available products</returns>
    [WebMethod]
    public IEnumerable<TempJson> ReadAds()
    {
 
        JobHistoryDB sdb = new JobHistoryDB();
        JobHistoryCollection myCollection = new JobHistoryCollection();
        List<TempJson> returned = new List<TempJson>();
        foreach (JobHistory j in sdb.GetAll())
        {
            TempJson mj = new TempJson();
            mj.Id = j.JobHistoryID;
            mj.FirstName = j.JobTitle;
            mj.LastName = j.CompanyName;
            mj.BirthDate = j.Start.ToShortDateString();
 
            returned.Add(mj);
        }
        return returned;
 
    }
 
    /// <summary>
    /// Updates existing products by updating the database with the data posted by the Kendo Grid.
    /// </summary>
    /// <param name="products">The products updated by the user</param>
    [WebMethod]
    public void UpdateAds(IEnumerable<TempJson> products)
    {
 
        JobHistoryDB sdb = new JobHistoryDB();
        JobHistoryCollection myCollection = new JobHistoryCollection();
 
        foreach (TempJson j in products)
        {
            JobHistory my = sdb.GetByPK_JobHistory(j.Id)[0];
            my.End = DateTime.Parse(j.BirthDate);
            my.JobTitle = j.FirstName;
            myCollection.Add(my);
        }
 
 
 
        sdb.Update(myCollection);
 
    }
 
    /// <summary>
    /// Destroys existing products by deleting them from the database.
    /// </summary>
    /// <param name="products">The products deleted by the user</param>
    [WebMethod]
    public void DestroyAds(IEnumerable<TempJson> products)
    {
        JobHistoryDB sdb = new JobHistoryDB();
        JobHistoryCollection myCollection = new JobHistoryCollection();
 
        foreach (TempJson j in products)
        {
            JobHistory my = sdb.GetByPK_JobHistory(j.Id)[0];
 
            myCollection.Add(my);
        }
 
 
 
        sdb.Delete(myCollection);
    }
 
     
}
 
public class TempJson
{
    public int Id { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string City { get; set; }
    public string BirthDate { get; set; }
}

thanks
Alexander Valchev
Telerik team
 answered on 30 Mar 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
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
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?