Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Grid Data refresh
27/04/2010
00:07
Avatar
mnagireddy
Member
Members
Forum Posts: 7
Member Since:
26/04/2010
sp_UserOfflineSmall Offline

Hi , 

I am relatively new user for Jquery/JqGrid .

I am working on a project which needs to move the Data between two grids.

1)      Initially the data will load from the server for the both grids.

2)      Then user should able to move the data between these two grids (not submit/load the data from the server) client side.

3)      There are some other form elements users needs to input before submit the changes to server.

function assignDistGroups(fromGrid, toGrid){

    var selArr = $('#' + fromGrid).jqGrid('getGridParam', 'selarrrow');

    console.log("Selected rows on Available Dist :" + selArr);

    $.each(selArr, function(value){

        var selectedRowId = selArr[value];

        var rowData = $('#' + fromGrid).jqGrid('getRowData', selectedRowId);

        console.log("Value :" + value);

        console.log("Selected Row Index Value :" + selectedRowId);

        console.log("Row Data Group Name :" + rowData['distGroupName']);

        var isAddSuccessful = $('#' + toGrid).jqGrid('addRowData', selectedRowId, rowData, 'after', null);

            var isRemoveSuccessful = $('#'+fromGrid).jqGrid('delRowData', selectedRowId);

        console.log("Is Successfully Added  :" + isAddSuccessful);

        console.log("Is Successfully Removed  :" + isRemoveSuccessful);

    });

      $('#'+fromGrid).trigger("reloadGrid");

      $('#'+toGrid).trigger("reloadGrid");

    return false;

}

$('#'+fromGrid).trigger("reloadGrid");

$('#'+toGrid).trigger("reloadGrid");

The .trigger(“reloadGrid”) call is refreshing from the server. Is there a way I can just refresh client side?

Thank you,

Mohan

05/05/2010
21:46
Avatar
mnagireddy
Member
Members
Forum Posts: 7
Member Since:
26/04/2010
sp_UserOfflineSmall Offline

Can someone please shed some light on this query please?

I am trying to do move the grid rows between two grids before I submit to the server?

 Thank you,

Mohan

09/05/2010
13:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

The trick is: before triggering the grid's set its datatype to "local".

Also you can switch from datatype to datatype without problems.

For this purpose you can use setGridParam({datatype:'local'});

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

09/05/2010
14:06
Avatar
mnagireddy
Member
Members
Forum Posts: 7
Member Since:
26/04/2010
sp_UserOfflineSmall Offline

I will try 

Thank you so much. 

Madan

09/05/2010
14:31
Avatar
mnagireddy
Member
Members
Forum Posts: 7
Member Since:
26/04/2010
sp_UserOfflineSmall Offline

Hi Tony, 

It worked perfectly. You saved my Sunday. 

Thank you,

Madan

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
69 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information