Modifying DataSource

Hi,

I'm loading a partial view via ajax and then modifying the DataSource in JavaScript.

How do I load the modified DataSource into the grid?

I've tried:
  var gridObj = $("#MyGrid").data("ejGrid"); 
 gridObj.dataSource(ModifiedData);
but I get the following error:
ej.web.all.js:114408 Uncaught TypeError: Cannot read property 'find' of null
On this line: this.getContentTable().find("colgroup").first().replaceWith(this._getMetaColGroup());

Many thanks,

Avi

3 Replies

MP Manivannan Padmanaban Syncfusion Team June 5, 2018 03:11 AM UTC

Hi Avi, 

Thanks for contacting syncfusion support. We are happy to assist you. 

We have analyzed your query and we are able to understand that you are facing the script error while modifying the grid data source through datasource method of ejgrid. The reported error will occur on below scenario, 

  1. If the initial grouping is enabled, at initial load the grid content is needed. In this case if you modified the datasource at initially then the this.getcontent is undefined due this the above mentioned issue will occur.

To avoid the above mentioned issue we suggest you to change the grid datasource on external button click . For your convenience we have created the sample please refer the below link for sample 


After referring the above details, still facing the issue please get back to us with the following details that help us to resolve the issue as early as possible. 

  1. Share the requirement details.
  2. Share the stack trace.
  3. Share the console screenshot.
  4. Share the grid code example.

Regards, 

Manivannan Padmanaban. 



AS Avi Segal June 5, 2018 10:51 AM UTC

Perfect! 

Thanks

Avi




MP Manivannan Padmanaban Syncfusion Team June 6, 2018 03:40 AM UTC

Hi Avi, 

Thanks for the update.  

We are happy to hear that your problem has been solved.  Please let us know if you need further assistance. 

Regards, 

Manivannan Padmanaban. 



Loader.
Up arrow icon