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
bugg with required
01/12/2009
18:00
Avatar
missa
france
Member
Members
Forum Posts: 104
Member Since:
20/02/2009
sp_UserOfflineSmall Offline

Hello,

if a colModel is define with the editrules required: true and In the grid when the user enters the letter 's' only and want validate is field.

The grid write a message: the field is requiered.

Do you have an idea?

thank you.

missaKiss

02/12/2009
09:00
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

02/12/2009
11:18
Avatar
missa
france
Member
Members
Forum Posts: 104
Member Since:
20/02/2009
sp_UserOfflineSmall Offline

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.Smile this error occured with all my grid that I create with edit or add button of navGrid. Frown

MissaKiss

02/12/2009
11:19
Avatar
missa
france
Member
Members
Forum Posts: 104
Member Since:
20/02/2009
sp_UserOfflineSmall Offline

this error occured with version 3.5 and 3.6.

thank you.

Regards

MissaLaugh

03/12/2009
13:14
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

04/12/2009
09:33
Avatar
missa
france
Member
Members
Forum Posts: 104
Member Since:
20/02/2009
sp_UserOfflineSmall Offline

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.Yell this is the originial code.Embarassed

 

Thank you for your help.

MissaKiss

05/12/2009
13:54
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

07/12/2009
10:46
Avatar
missa
france
Member
Members
Forum Posts: 104
Member Since:
20/02/2009
sp_UserOfflineSmall Offline

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.

MissaKiss

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information