Forum


08:44

20/02/2009

Hello,
It's very important. I don't understand why buttons "add", "delete" "search" don't work.
If I don't find the solution, I will have big problem with my boss. please help me!!! below, it's my cod:
<script type="text/javascript">
// syntaxe pour creer le GRID
jQuery(document).ready(function(){
var lastsel;
jQuery("#client").jqGrid({
url:'/paiement/traitement/server.php?nd='+new Date().getTime(),
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'invid',index:'invid', width:55,sorttype:"int"},
{name:'invdate',index:'invdate', width:90,editable:true,sorttype:"date",formatter:'date',formatoptions:{newformat: 'd/m/Y'}},
{name:'name',index:'name', width:100,editable:true,sorttype:"text"},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float",editable:true,editrules:{number:true}},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float",editable:true,editrules:{number:true}},
{name:'total',index:'total', width:80,align:"right",sorttype:"float",editable:true,editrules:{number:true}},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: jQuery('#pclient'),
sortname: 'invid',
imgpath: '/paiement/jqgrid/themes/coffee/images/',
viewrecords: true,
sortorder: "asc",
caption: "tableau test",
onSelectRow: function(invid){
if(invid && invid!==lastsel){
var ret = jQuery("#client").getRowData(invid);
jQuery('#client').restoreRow(lastsel);
//jQuery('#client').editRow(invid,true,pickdates,success,'/paiement/traitement/mise_a_jour_bd.php',{'invid':+ret.invid},aftersavefunc,onerrorfunc);
jQuery('#client').editRow(invid,true,pickdates,'','/paiement/traitement/mise_a_jour_bd.php',{'invid':+ret.invid},'',onerrorfunc);
lastsel=invid;
}
},
editurl: "/paiement/traitement/server.php",
}).navGrid('#pclient', {refresh:true,add:true,del:true,search:true,edit:false}
);
//with button out the nav bar
$("#search").click(function(){
jQuery("#client").searchGrid(
{sopt:['cn','bw','eq','ne','lt','gt','ew']}
);
});
$("#add").click(function(){
jQuery("#client").editGridRow("new",{height:280,reloadAfterSubmit:false,addCaption: "Add Record"});
});
function pickdates(invid){
jQuery("#"+invid+"_invdate","#client").datepicker({dateFormat:"dd/mm/yy"});
}
function onerrorfunc() {
alert('La mise à jour de la base de données c\\'est mal passée!');
}
});
Please, help me. It's very important!!!!!!!!
thank you all!!
Aurore
09:29

20/02/2009

Hello,
It doesn't work. Thank you!.
I use the cod extract from this site:
http://trirand.com/jqgrid/jqgrid.html
because I'm a novice in development!
Thank you!
04:11

20/02/2009

Thank you for your help!
Is it possible that editrow("new",{url:'delete.php'}) is incompatible with the option:
Onselectrow:function(id){
if(invid && invid!==lastsel){
var ret = jQuery("#client").getRowData(invid);
jQuery('#client').restoreRow(lastsel);
//jQuery('#client').editRow(invid,true,pickdates,success,'/paiement/traitement/mise_a_jour_bd.php',{'invid':+ret.invid},aftersavefunc,onerrorfunc);
jQuery('#client').editRow(invid,true,pickdates,'','/paiement/traitement/mise_a_jour_bd.php',{'invid':+ret.invid},'',onerrorfunc);
lastsel=invid;
}
}
Because, nothing work!!!
thank you for your answer!
Aurore
Most Users Ever Online: 715
Currently Online:
50 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