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
Move Data from one grid to another
19/11/2009
15:50
Avatar
tobias
Member
Members
Forum Posts: 4
Member Since:
20/11/2009
sp_UserOfflineSmall Offline

I am trying to set up a website that works on a campaign mentality allowing the user to select items from one grid to populate a second grid.  The second grid is the list of people targetted in this campaign.  I have set up drag and drop between them (which is very nice).  The part that I am having issues with is seting up a button to move all items from one grid to another.  Below is the code for each button.  I am using version 3.6.  What happens (when the move down button is pushed) is that all but one of the items from the first grid is moved down to the second grid, with the addition of a blank row.  When the move up is pushed, it moves all up including the blank row.  Pushing the move down button again, moves all 6 rows and the extra blank row down. 

Any ideas?

$('#campaign-moveup').click(function() {
    var RowList;
RowList = $(”#grid2″).getRowData();
var Row;
for( Row in RowList )
{
 $(”#grid1″).addRowData(Row,$(”#grid2″).getRowData(Row));
 $(”#grid2″).delRowData(Row);
}
})
$('#campaign-movedown').click(function() {
    var RowList;
RowList = $(”#grid1″).getRowData();
var Row;
for( Row in RowList )
{
 $(”#grid2″).addRowData(Row,$(”#grid1″).getRowData(Row));
 $(”#grid1″).delRowData(Row);
}
})

21/11/2009
07:53
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Could you please try this:

$('#campaign-moveup').click(function() {
    var RowList;
RowList = $('#grid2').getRowData();
var Row;
for( Row in RowList )
{
 $('#grid1').addRowData(Row,RowList[Row]);
}

$("#grid2).clearGridData();
});

The same for the second

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.

23/11/2009
14:32
Avatar
tobias
Member
Members
Forum Posts: 4
Member Since:
20/11/2009
sp_UserOfflineSmall Offline

I did that and was able to move the rows down, but I received a TypeError : "Object doesn't support this property or method" on the clearGridData.  This is with Jquery 3.2.1.

23/11/2009
16:51
Avatar
tobias
Member
Members
Forum Posts: 4
Member Since:
20/11/2009
sp_UserOfflineSmall Offline

Nevermind, I must have typed it in wrong.  After going down a different path, I came back and redid it and it works just fine now.  Thanks

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
93 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