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
Need help with hide/show column & datepicker & count of columns
27/07/2008
11:00
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

hi Tony,

this is just a great plugin..

i have three problems with jqGrid and it seems i can't solve them out.

  • i can't have more than 16 columns in jqGrid.. and i don't know why
    I think its a bug or something.. please check this (http://www.trirand.com/blog/?p.....omment-590)
  • i've tried and tried to show and hide the columns but it was useless.
    i need some help. can you tell me what is wrong with the following code?
  • the same thing with the datepicker.. i couldn't make it work.. please if you don't mind just tell me how to make this column "issueDate" works with "datepicker"?

here is my code (php):

.....
echo <<<EOF

<script type="text/javascript">
    jqGridInclude("$JS/grid/");
    jQuery(document).ready(function(){
        jQuery("#Table").jqGrid({
            url:'?Option=show',
            datatype: "json",
            mtype: 'POST',
            colNames:['ID', '$ArName', '$EnName', '$Sex', '$FileNo', '$RefNo', '$Salary', '$Contract', '$PassNo', '$ArIssuePlace', '$EnIssuePlace', '$IssueDate', '$ExpireDate', '$Nationality', '$Religion', '$Occupation'],
            colModel:[
                {name:'ID',index:'ID', width:50,editable:false,editoptions:{readonly:true,size:10}},
                {name:'arName',index:'arName', width:155,editable:true,editoptions:{size:36}},
                {name:'enName',index:'enName', width:155,editable:true,editoptions:{size:36}},
                {name:'Sex',index:'Sex', width:90, editable: true,edittype:"select",editoptions:{value:"ID:Value;ID:Value"}},
                {name:'fileNo',index:'fileNo', width:100,editable:true,editoptions:{size:36}},
                {name:'refNo',index:'refNo', width:100,editable:true,editoptions:{size:36}},
                {name:'Salary',index:'Salary', width:80,editable:true,editoptions:{size:36}},
                {name:'Contract',index:'Contract', width:85,editable:true,editoptions:{size:36}},
                {name:'passportNo',index:'passportNo', width:110,editable:true,editoptions:{size:36}},
                {name:'arIssuePlace',index:'arIssuePlace', width:180,editable:true,editoptions:{size:36}},
                {name:'enIssuePlace',index:'enIssuePlace', width:180,editable:true,editoptions:{size:36}},
                {name:'issueDate',index:'issueDate', width:120,editable:true,editoptions:{size:36},sorttype:"date"},
                {name:'issueExpiry',index:'issueExpiry', width:120,editable:true,editoptions:{size:36},sorttype:"date"},
                {name:'Nationality',index:'Nationality', width:110, editable: true,edittype:"select",editoptions:{value:"ID:Value;ID:Value"}},
                {name:'Religion',index:'Religion', width:110, editable: true,edittype:"select",editoptions:{value:"ID:Value;ID:Value"}},
                {name:'Occupation',index:'Occupation', width:110, editable: true,edittype:"select",editoptions:{value:"ID:Value;ID:Value"}}
            ],
            rowNum:10,
            rowList:[10,25,50,75,100],
            pager: jQuery('#Bar'),
            imgpath: '$JS/grid/themes/basic/images',
            sortname: 'ID',
            viewrecords: true,
            sortorder: "desc",
            recordtext: "$Rows",
            caption:"$Caption",
            editurl:"?Option=modify",
            multiselect:true,
            loadui:'block',
            loadtext: "$LoadMsg",
            height:'100%'
        }).navGrid('#Bar',
            {}, //options
            {height:410,width:400,reloadAfterSubmit:false}, // edit options
            {height:400,reloadAfterSubmit:true}, // add options
            {reloadAfterSubmit:false}, // del options
            {} // search options
        );
    });
   
    jQuery("#HideID").click( function() {
        jQuery("#Table").hideCol(["ID"]);
    });
    jQuery("#ShowID").click( function() {
        jQuery("#Table").showCol(["ID"]);
    });
</script>

<a href="javascript:void(0)" id="HideID">Hide column ID</a><br/>
<a href="javascript:void(0)" id="ShowID">Show column ID</a>

EOF;
.....

Thanks a lot Tony..
Best regards.

28/07/2008
02:33
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

1. About the first issue. I do not think that this is a bug.

You can perform some test. Set the width of all columns

to be 25-30 and see if all columns are here. I'm not sure, but

maybe you have enclose the grid in html element which have

overflow hidden.

2. For a single show and hide use jQuery(”#Table”).hideCol("ID")

and not as array - I will check this.

3. Where - in inline editing or in form editing module. If this is

in form editing you can use onInitializeForm event to attach

datepicker to element

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.

31/07/2008
09:29
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

Thanks a lot Tony,..

the main cause of th first issue was the " ' " it was in the language file for example (Tony's website)

and the second issue is solved when i add the show/hide in

jQuery(document).ready(function(){

 ...........

}

but the third issue.. i don't know how to do it... if you just give an example on my previous code... i'll be greatful

Best Regards

DeaDSouL

01/08/2008
03:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

...

            loadtext: “$LoadMsg”,
            height:'100%'
        }).navGrid('#Bar',
            {}, //options

            {height:410,width:400,reloadAfterSubmit:false,

onInitializeForm: function(formid) {

$(”#issueDate”,formid).datepicker({dateFormat:”yy-mm-dd”});

}

}, // edit options
            {height:400,reloadAfterSubmit:true,

onInitializeForm: function(formid) {

$(”#issueDate”,formid).datepicker({dateFormat:”yy-mm-dd”});

}

}, // add options
            {reloadAfterSubmit:false}, // del options
            {} // search options
        );
    });

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.

01/08/2008
10:29
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

thanks a lot Tony..

I'll give it a try

Best regards

Thanks again

02/08/2008
23:08
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

how are you today Tony?

about the datepicker.. it didn't work properly..
well, it shows the calender but i can't select the date.. because of the edit/add window..

please check it

ya, one more thing.. the multiselect doesn't work with the "Custom edit"

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

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

About the first issue. This is z-Index problem. I will change this behavior. Currently you can resolve this when you edit the datepicke css and change the z-index of the datepicker to something like z-index:3500. By default jqModal uses 3000 to z-index.

What you mean multiselect does not work in "Custom edit"? -  What is "Custom edit"?

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.

04/08/2008
11:04
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

Thanks for help Tony

"What you mean multiselect does not work in “Custom edit”? -  What is “Custom edit”?"

I ment that you can't use "multiselect:true" in the “Custom edit” example page in the demo folder.

I wonder is there anyway to make the value selected by default if I used (edittype:"select") ?

Now, if I used (edittype:"select"), I wonder if there is anyway to make the default value (the selected value before editing) is selected when I edit the row.

like this (<option value="32" selected>...</option>)

Thanks for everything bro

Regards

05/08/2008
01:31
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

If you use edittype:select the value text that is displayed in a table cell is selected by default. If you add new row a first one is selected.

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/08/2008
20:39
Avatar
DeaDSouL
Member
Members
Forum Posts: 22
Member Since:
27/07/2008
sp_UserOfflineSmall Offline

I see..

Thanks a lot brother 

you are so helpful

best regards

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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