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
Help : Required input field
17/08/2008
05:07
Avatar
garnett21
Member
Members
Forum Posts: 17
Member Since:
02/08/2008
sp_UserOfflineSmall Offline

Hi,

I've made a 2 column grid.

My colModel is defined like this. 

colModel :[
                    {name:'subRegionName', index:'SUBREGION_NAME',width:100,editable:true,editoptions:{size:30},editrules:{required:true,number:false}},
                    {name:'idRegion', index:'REGION_ID',width:100,editable:true,edittype:"select",editoptions:{<? echo $regionValues;?>},editrules:{required:true,number:true}}],

In form edit mode I want to set the two field as "required"

When i want to add a row a modal form appears, I do not enter any values for the first field and it never tell me that field is required.Why? It's a bug?

When I have an only field in my form it works properly...

17/08/2008
05:39
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Currently this option works only on field of type text and textarea.

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.

17/08/2008
07:31
Avatar
garnett21
Member
Members
Forum Posts: 17
Member Since:
02/08/2008
sp_UserOfflineSmall Offline

tony said:

Hello,

Currently this option works only on field of type text and textarea.

Regards

Tony


Ok,

with this code it gives me an error message on the second field?Is it normal?

{name:'idCustomer', index:'CUSTOMER_ID',editable:true,edittype:"text",editrules:{required:true},width:115},
                {name:'name', index:'NAME',editable:true,edittype:"text",editrules:{required:true},width:170} ,
17/08/2008
08:13
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

What of error?

What is the error message?

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.

17/08/2008
09:14
Avatar
garnett21
Member
Members
Forum Posts: 17
Member Since:
02/08/2008
sp_UserOfflineSmall Offline

I put the required option on the 2 column.

When I add a row with an empty form, I got the reqired field message for the second colum an not for the first one.

17/08/2008
09:33
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

To have idea please post the entry jqGridl array - I recommend to

make copy paste here.

Please use the latest release of jqGrid

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.

17/08/2008
10:57
Avatar
garnett21
Member
Members
Forum Posts: 17
Member Since:
02/08/2008
sp_UserOfflineSmall Offline

Ok so I made something like this

$(”#listCustomers”).jqGrid({
url:'include/gridCustomers.php?&nd='+new Date().getTime(),
editurl:'include/gridCustomers.php?&nd='+new Date().getTime(),
datatype: 'json',
colNames:['Customerno','Customername','Company Group','Adress','City','Country','Language','Product','Format','Category','Keycustomer'],
colModel :[
{name:'idCustomer', index:'CUSTOMER_ID',editable:true,edittype:"text",editrules:{required:true},width:115},
{name:'name', index:'NAME',editable:true,edittype:"text",editrules:{required:true},width:170} ,
{name:'idCompany', index:'COMPANY_ID',editable:true,edittype:"select",editoptions:{value:'0:'},editrules:{required:true,number:true,minvalue:1},width:140},
{name:'adress', index:'ADRESS',editable:true,edittype:"text",editrules:{required:true},width:210} ,
{name:'city', index:'CITY',editable:true,edittype:"text",editrules:{required:true}},
{name:'idCountry', index:'COUNTRY_ID',editable:true,edittype:"select",editoptions:{value:'0:;3:Belgium;2:Canada;4:Holland;13:Ivory Coast;1:Mexico'},editrules:{required:true},width:100},
{name:'idLanguage', index:'LANGUAGE_ID',editable:true,edittype:"select",editoptions:{value:'0:'},editrules:{required:true},width:100} ,
{name:'idProduct', index:'PRODUCT_TYPE_ID',editable:true,edittype:"select",editoptions:{value:'0:'},editrules:{required:true},width:80},
{name:'idFormat', index:'FORMAT_ID',editable:true,edittype:"select",editoptions:{value:'0:'},editrules:{required:true},width:80},
{name:'idCategory', index:'CATEGORY_ID',editable:true,edittype:"select",editoptions:{value:'0:'},editrules:{required:true},width:90},
{name:'keyCustomer', index:'KEYCUSTOMER',hidden:true,editable:true,editrules:{edithidden:true}, edittype:"checkbox",editoptions:{value:'1:0'}}],
pager: $('#pagerCustomers'),
recordtext: 'customers',
shrinkToFit:true,
width:900,
height:230,
rowNum:10,
rowList:[10,20,30],
sortname: 'NAME',
sortorder: “desc”,
viewrecords: true,
imgpath: 'design/themes/basic/images',
shrinkToFit:true
})

As you can see “idCustomer” and “name” are required.When i fill my form and put nothing in each of these field I got this message :

Customername: Field is required

Normally I should havethis message first no?

Customerno: Field is required

I have jdGrid 2.3.1

17/08/2008
11:50
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Thanks,

It is a bug. It is corrected.

TO work this open grid.formedit.js and find function checkValues

Replace:

 function checkValues(val, valref) {
  if(valref)

....

with

function checkValues(val, valref) {
   if(valref >=0)

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.

17/08/2008
14:32
Avatar
garnett21
Member
Members
Forum Posts: 17
Member Since:
02/08/2008
sp_UserOfflineSmall Offline

I've modified the file, but nothing change

Cry

18/08/2008
02:46
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Be a sure that you use the development version, but not min.

It should work. Also clear the cache

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.

18/08/2008
04:15
Avatar
garnett21
Member
Members
Forum Posts: 17
Member Since:
02/08/2008
sp_UserOfflineSmall Offline

I've set the 'minver' variable to false in jqgrid.js

var minver = false;

but it still use minfiles instead of development version.

what I've to do? remove all the minfile definitions in the jqGrid.js?

18/08/2008
08:12
Avatar
garnett21
Member
Members
Forum Posts: 17
Member Since:
02/08/2008
sp_UserOfflineSmall Offline

Ok,

the problem has been solved.

It seems that the editrules works from the second column of the colmodel.

So i add an non editable column in my colmodel at the first position and it works now

18/08/2008
09:29
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

I do not think so. This is a bug.

Also I think that there is a cashe that is not cleared.

Please clear the cache, switch to development version and try

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.

19/08/2008
03:39
Avatar
garnett21
Member
Members
Forum Posts: 17
Member Since:
02/08/2008
sp_UserOfflineSmall Offline

How to switch to developpement version?

19/08/2008
04:41
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Clear all the cache and

var minver = false;

Reagrds

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
74 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