i have 3 radgrid. want rebind 3 radgrid @ once popup window closed. @ time rebinds 1 radgrid. code here:
$('.close-modal').click(function (e) { $('.modal, .modal-backdrop').fadeout('fast'); var mymeeting = $find("<% =gridmymeeting.clientid %>").get_mastertableview(); var allmeeting = $find("<% =gridallmeeting.clientid %>").get_mastertableview(); var activemeeting = $find("<% =gridactivemeeting.clientid %>").get_mastertableview(); mymeeting.rebind(); allmeeting.rebind(); activemeeting.rebind(); });* function rebind() { $find("<% =gridmymeeting.clientid %>").get_mastertableview().rebind(); $find("<% =gridallmeeting.clientid %>").get_mastertableview().rebind(); $find("<% =gridmymeeting.clientid %>").get_mastertableview().rebind(); }*
i guess want rebind grid's @ same time not simultaneously. javascript not have concept of multi-threading can achieved using settimeout , setinterval methods.
since grids need refreshed once, settimeout enough. have modified code below
$('.close-modal').click(function (e) { $('.modal, .modal-backdrop').fadeout('fast'); //storing id of grids in array var gridid = ["<% = gridmymeeting.clientid %>", "<% = gridallmeeting.clientid %>", "<% = gridmymeeting.clientid %>"]; //using settimeout in loop rebind grid data @ same time for(var i=0; i<gridid.length; i++) { window.settimeout(function(){ var table = $find(gridid[i]).get_mastertableview(); table.rebind(); }, 10); } });
above code refresh grids @ interval of 10 milliseconds. can specify interval value based on requirement in settimeout
function
Comments
Post a Comment