Forum
09:00
Moderators
30/10/2007
Hello,
As usual this does not help you.
Please - post your code
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.
11:18
20/02/2009
Hello Tony,
this is my code.
var $appel_include = "traitement/barre_navigation_inc.php";
$(document).ready(function(){
$('#loading').hide();
var lastsel;
$("#barre_nav").jqGrid({
url:$url_GRID,
datatype: "json",
postData:{appel_include:$appel_include},
colNames:['Inv No','Date','Client','Amount','Tax','Total','Notes','liste','celiba'],
colModel:[
{name:'invid',index:'invid',width:100,search:false,sorttype:"int"},
{name:'invdate',index:'invdate',width:100,searchoptions:{dataInit:function(elem){$(elem).datepick();}},
editable:true,
sorttype:"date",
datefmt:"dd/mm/yyyy",
formatter:'date',
editrules:{date:true,required:false}
},
{name:'name',index:'name',width:180,
searchoptions:{searchhidden:true},
hidden:true,
editable:true,
sorttype:"text",
editoptions:{
size:"30",
maxlength:"30"} },
{name:'amount',index:'amount',width:100,
align:"right",
sorttype:"float",
editable:true,
editrules:{number:true},
editoptions:{size:"30",maxlength:"30"}
},
{name:'tax',index:'tax', width:100,
align:"right",
sorttype:"float",
editable:true,
editrules:{number:true}
},
{name:'total',index:'total',width:100,
align:"right",
sorttype:"float",
editable:true,
editrules:{number:true}
},
{name:'note',index:'note',width:100,
sortable:false,
editable:true
},
{name:'liste',index:'liste', width:90,
editable: true,
formatter:'select',
edittype:"select",
editoptions:{value:"FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"},hidden:true, editrules:{edithidden:false}},
{name:'celiba',index:'celiba', width:30,
editable: true,
// formatter:'checkbox',
edittype:"checkbox",
editoptions:{value:"Yes:No"}}
],
rowNum:2000,
pgbuttons: false,
pginput: false,
pgtext:false,
pager: $('#pbarre_nav'),
sortname: 'invid',
viewrecords: true,
sortorder: "asc",
caption: "Fonctionnalite de la barre de navigation",
editurl: $url_GRID,
autowidth:true,
loadError : function(xhr,st,err) {
$("#rsperror").html("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);
},
gridComplete: function(){
hauteur_grid('barre_nav',15);
}
}).navGrid('#pbarre_nav', {add:true,refresh:true,del:true,search:true,edit:true,view:true},
{modal:true,url:$url_select,closeAfterEdit:true,
var sr = $('#barre_nav').getGridParam('selrow');
var rowData = $('#barre_nav').getRowData(sr);
return this.editData = {'invid': rowData['invid'],'type_action':'maj'};
},
afterSubmit: function($result) {
if ($result.responseText == 'ok'){
alert("Ma requete d'ajout c'est bien passée!");
}
else {
alert("J'ai eu un pb dans ma requete:" + $result.responseText);
}
return true;
}
}, /*edit options*/
{modal:true,url:$url_select,
beforeSubmit: function() {
return this.editData = {'type_action':'ajout'};
},
afterSubmit: function($result) {
if ($result.responseText == 'ok'){
alert("Ma requete d'ajout c'est bien passée!");
}
else {
alert("J'ai eu un pb dans ma requete:" + $result.responseText);
}
$('#cData').click();
return true; }
}, /* add options*/
{width: 500, modal:true,url:$url_select,closeOnEscape:true,
beforeSubmit: function() {
var sr = $('#barre_nav').getGridParam('selrow');
var rowData = $('#barre_nav').getRowData(sr);
return this.delData = {'invid': rowData['invid'],'type_action':'suppression'};
},
afterSubmit: function(){
$('#eData').click();
return true;
}
}, /* delete options*/
{modal:true,url:$url_GRID,width: 500
} /* search options*/
);
$("#parametre_serveur").click( function() {
var pd =$("#barre_nav").getPostData();
var r ="";
$.each(pd,function(i){ r += i+": "+pd[i]+","; })
$("#postdata").html(r).css("background-color","yellow");
});
});
Thank you for your help. this error occured with all my grid that I create with edit or add button of navGrid.
Missa
13:14
Moderators
30/10/2007
Hello,
For which field is happen this?
I see only required in the date field - right, but requiered is false.
Is this the original code?
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:33
20/02/2009
Hello Tony,
this is my code.
var $appel_include = “traitement/barre_navigation_inc.php”;
$(document).ready(function(){
$('#loading').hide();
var lastsel;
$(”#barre_nav”).jqGrid({
url:$url_GRID,
datatype: “json”,
postData:{appel_include:$appel_include},
colNames:['Inv No','Date','Client','Amount','Tax','Total','Notes','liste','celiba'],
colModel:[
{name:'invid',index:'invid',width:100,search:false,sorttype:"int"},
{name:'invdate',index:'invdate',width:100,searchoptions:{dataInit:function(elem){$(elem).datepick();}},
editable:true,
sorttype:"date",
datefmt:"dd/mm/yyyy",
formatter:'date',
editrules:{date:true,required:false}
},
{name:'name',index:'name',width:180,
editable:true,
sorttype:"text",
editrules:{required:false},
editoptions:{
size:"30",
maxlength:"30"} },
{name:'amount',index:'amount',width:100,
align:"right",
sorttype:"float",
editable:true,
editrules:{number:true},
editoptions:{size:"30",maxlength:"30"}
},
{name:'tax',index:'tax', width:100,
align:"right",
sorttype:"float",
editable:true,
editrules:{number:true}
},
{name:'total',index:'total',width:100,
align:"right",
sorttype:"float",
editable:true,
editrules:{number:true}
},
{name:'note',index:'note',width:100,
sortable:false,
editable:true
},
{name:'liste',index:'liste', width:90,
editable: true,
formatter:'select',
edittype:"select",
editoptions:{value:"FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"},hidden:true, editrules:{edithidden:false}},
{name:'celiba',index:'celiba', width:30,
editable: true,
// formatter:'checkbox',
edittype:"checkbox",
editoptions:{value:"Yes:No"}}
],
rowNum:2000,
pgbuttons: false,
pginput: false,
pgtext:false,
pager: $('#pbarre_nav'),
sortname: 'invid',
viewrecords: true,
sortorder: “asc”,
caption: “Fonctionnalite de la barre de navigation”,
editurl: $url_GRID,
autowidth:true,
loadError : function(xhr,st,err) {
$(”#rsperror”).html(”Type: “+st+”; Response: “+ xhr.status + ” “+xhr.statusText);
},
gridComplete: function(){
hauteur_grid('barre_nav',15);
}
}).navGrid('#pbarre_nav', {add:true,refresh:true,del:true,search:true,edit:true,view:true},
{modal:true,url:$url_select,closeAfterEdit:true,
var sr = $('#barre_nav').getGridParam('selrow');
var rowData = $('#barre_nav').getRowData(sr);
return this.editData = {'invid': rowData['invid'],'type_action':'maj'};
},
afterSubmit: function($result) {
if ($result.responseText == 'ok'){
alert(”Ma requete d'ajout c'est bien passée!”);
}
else {
alert(”J'ai eu un pb dans ma requete:” + $result.responseText);
}
return true;
}
}, /*edit options*/
{modal:true,url:$url_select,
beforeSubmit: function() {
return this.editData = {'type_action':'ajout'};
},
afterSubmit: function($result) {
if ($result.responseText == 'ok'){
alert(”Ma requete d'ajout c'est bien passée!”);
}
else {
alert(”J'ai eu un pb dans ma requete:” + $result.responseText);
}
$('#cData').click();
return true; }
}, /* add options*/
{width: 500, modal:true,url:$url_select,closeOnEscape:true,
beforeSubmit: function() {
var sr = $('#barre_nav').getGridParam('selrow');
var rowData = $('#barre_nav').getRowData(sr);
return this.delData = {'invid': rowData['invid'],'type_action':'suppression'};
},
afterSubmit: function(){
$('#eData').click();
return true;
}
}, /* delete options*/
{modal:true,url:$url_GRID,width: 500
} /* search options*/
);
$(”#parametre_serveur”).click( function() {
var pd =$(”#barre_nav”).getPostData();
var r =”";
$.each(pd,function(i){ r += i+”: “+pd[i]+”,”; })
$(”#postdata”).html(r).css(”background-color”,”yellow”);
});
});
Sorry Tony I make a mistake. this is the originial code.
Thank you for your help.
Missa
13:54
Moderators
30/10/2007
Hello,
Could not understand what you mean - in my demos evrething is ok.
If you set required:false - the checking is not performed, this is usefull if you want to have empty values, but want to check numbers and etc.
requiered : true works for as expected.
Best 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.
10:46
20/02/2009
Hello Tony,
I'm sorry, for the last code required equals true. it's a mistake. When name is requiered: true and when we use editrow with navgrid it doesn't work well.
If you enter only 's' in a required field a message appears.
Thank you for your help. in your demo, in wich example you use required editrules with navgrid edit. I can try to test on your demo.
Regards.
Missa
Most Users Ever Online: 715
Currently Online:
94 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