Forum


09:33

20/03/2009

Hi,
I've added an extra button on the nav bar which allows managers to approve items added to the grid. The button adds just fine and the function fires for the button click event but the saveRow call never forward to my url. I have some debug lines of code in ApproveEntry.php and nothing is routed to the console but the grid reloads afterwards.
Any suggestions ? Perhaps I am using the saveRow method in a wrong context but this seems correct.
Snippet of Code:
.navButtonAdd('#hoursNav',{buttonimg:"./css/artwork/icons/10/checkmark-10.gif",caption:"Approve Item",position:"last",title:"Approve Item", onClickButton:function(){
var gsr = jQuery('#hours').getGridParam('selrow');
var data = jQuery('#hours').getRowData(gsr);
var id = data.ID;
var tid = "PROJECTHOURS"
var aurl = "./actions/ApproveEntry.php";
jQuery('#hours').saveRow(id,false,aurl,{'table':tid});
jQuery('#hours').trigger("reloadGrid");
}
});
Nathan
02:36

Moderators
30/10/2007

Hello,
In order to work this the new added rows should have a attribute editable=1 - i.e the table row should have attribute editable=1
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.
06:53

20/03/2009

Hi Tony,
How do you set the row to editable ?
Currently I have that the field is editable:
{name: 'APPROVED', width:75, editable:true, align:'center',editrules:{required:true}, edittype:"checkbox",editoptions:{value:"1:0"},formatter:'checkbox'}
What I would like to do is have this appear in the table(checked or unchecked) but not appear on the form. Project managers should be able to select items from the grid and jus click approve.
Any suggestions on why my script does not fire ?
.navButtonAdd('#hoursNav',{buttonimg:"./css/artwork/icons/10/checkmark-10.gif",caption:"Approve Item",position:"last",title:"Approve Item", onClickButton:function(){
var gsr = jQuery('#hours').getGridParam('selrow');
var data = jQuery('#hours').getRowData(gsr);
var id = data.ID;
var tid = "PROJECTHOURS"
var aurl = "./actions/ApproveEntry.php";
jQuery('#hours').saveRow(id,editurl=aurl,extraparam={'table':tid,'approved':1});
jQuery('#hours').trigger("reloadGrid");
}
});
Thanks,
Nathan
03:00

Moderators
30/10/2007

Hello,
I suggest in this case to use own ajax something like this:
onClickButton:function(){
var gsr = jQuery('#hours').getGridParam('selrow');
var data = jQuery('#hours').getRowData(gsr);
var id = data.ID;
var tid = “PROJECTHOURS”
var aurl = “./actions/ApproveEntry.php”;
ajax({
url:aurl,
data:.....
complete : function (){
....
jQuery('#hours').trigger(”reloadGrid”);
...
}
});
}
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:
24 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