We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Question about Grid DataSource

I have defined a grid like this:

                               .Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.DataSourceTmp).InsertURL("AddResourceAllocation").UpdateURL("EditResourceAllocation").RemoveURL("DeleteResourceAllocation").Adaptor(AdaptorType.RemoteSaveAdaptor))
                 .EditSettings(es => es.AllowEditing(true))
                                                           .ToolbarSettings(ts => ts.ShowToolbar().ToolbarItems(ti =>
 .Columns(col =>
     col.Field("FirstName").HeaderText("First Name").Add();
     col.Field("LastName").HeaderText("Last Name").Add();
 .ClientSideEvents(cse => cse.BeginEdit("onBeginEditResource"))
function onClickResource(args) {
    var curGridElement = this.element.closest("div[id^='child3_grid']");
    var curGrid = $(curGridElement).ejGrid("instance");
    var index = this.element.closest("tr").index();
    var record = curGrid.getCurrentViewData()[index];
    var idProject = $("#Project_IdProject").val();
    var objData = { IdProject: idProject, record: record };
    eDialogAllocated.position = { X: this.element.offset().left - 900, Y: this.element.offset().top };
    var str = JSON.stringify(record);
    var jqxhr = $.post("@Url.Action("GetResourcesAllocatedCountry""Resources")", objData)
        .done(function(data) {
            var obj = $("#ResourceAllocated").ejGrid("instance");
        .fail(function(data) {
        .always(function() {

in which I need to reload the Datasource via Javascript.
After that, when I Edit the Record, the Edit Url is not called.
When I refresh the dataSource is it possible that the adaptor is lost?

  Thanks in advance

   Andrea Perazzolo

3 Replies

AP Andrea Perazzolo February 12, 2015 02:13 PM UTC

I noticed that this problem is in the Patched Service Pack scripts, and is not present in the previous version of the scripts.
When I reverted to the Script you provided me in January 20, the method is called even after the change of DataSource.
This version has another problem which  I asked in another thread, regarding the binding of the DateTime Fields.

    Andrea Perazzolo

AP Andrea Perazzolo February 13, 2015 07:45 AM UTC

I forgot to mention that the Grid is inside a Dialog Control, maybe this is the problem.
Regarding last reply, it was my mistake, the problem there is also with the other patched version of the scripts.

    Hope it helps

    Andrea Perazzolo

PK Prasanna Kumar Viswanathan Syncfusion Team February 13, 2015 10:31 AM UTC

Hi Andrea,

Thanks for using Syncfusion Products.

We have analyzed your sample and found that you have bounded the local data directly with the datasource that affects all URL’s, which is the root cause of the issue. So, we suggest you to use ej.DataManager for binding the data. While binding the data using ej.DataManager, we can include all insert/update and delete URL’s. Then, we have to bind that datamanager with the datasource.

Please find the below code snippet:


        click: function (args) {


                .done(function (data) {

                    var genData = ej.DataManager({ json: data, updateUrl: "NormalUpdate", insertUrl: "NormalInsert", removeUrl: "NormalDelete", adaptor: "remoteSaveAdaptor" })

                    var gridObj = $("#FlatGrid").ejGrid("instance");

                    gridObj.dataSource(genData);// Datasource bind to grid




For your convenience we have created a sample and sample can be downloaded from the below link

Sample Link :  http://www.syncfusion.com/downloads/support/directtrac/118221/Sample1182211678771919.zip

Please let us know if you have any queries,


Prasanna Kumar N.S.V

Live Chat Icon For mobile
Up arrow icon