javascript - How To Retrieve Grid Rows From Grid after Grid Refresh in CRM 2015 Update 1? -
crm 2015 update 1 add ability create onload events grids. hooked event grid's onload event, hoping whatever values have been added grid, when attempt rows, returns 0 rows when being called registered onload event:
// returns undefined when called grid's onload event, if user sorting grid xrm.page.getcontrol("contacts").getgrid().getrows().get(0);
is there away rows grid after user adds or removes row? code works fine if triggered outside of grid onload event.
here workaround not best way do.
settimeout(function () { var allgridrowdata = []; var rows = xrm.page.getcontrol("contacts").getgrid().getrows(); console.log(rows.length); rows.foreach(function (row, i) { allgridrowdata.push(row.getdata().getentity()); console.log(allgridrowdata); }); }, 2000);
it looks grid not loaded records when onload triggered.
Comments
Post a Comment