Forum


15:50

20/11/2009

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);
}
})
07:53

Moderators
30/10/2007

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66