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
Enable/Disable Custom Button on Nav Bar
02/04/2009
10:34
Avatar
Nathan
Member
Members
Forum Posts: 37
Member Since:
20/03/2009
sp_UserOfflineSmall Offline

Hi,

Just looking through the documentation and I can't seem to find a property that allows a custom button to be set to disabled.

Ie The button is there but does not do anything for certain users, but is active for others.

I've created a work around by outputing the entire generation of the button code with PEAR in the case of users that have access.  Users that don't have access don't even see the button.

What I would prefer to do is have option ie enabled:true/false and set dynamically based on user permissions.

Does this functionality exist ?

Nathan

02/04/2009
11:14
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Currently no, but it is easy to add this

Suppose the variable  edit_right  holds the edit rights for the user.

Set it during the opening the page and then

...navGrid("mypager",add_right, edit_right.....)

This way the buttons will be created according to the rights.

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.

02/04/2009
21:14
Avatar
Nathan
Member
Members
Forum Posts: 37
Member Since:
20/03/2009
sp_UserOfflineSmall Offline

Hi Tony,

I can see how this could apply to an existing button but how do apply it to a custom button ? I could certainly return a variable, edit_right which is valued as follows

edit_right = "edit:true" or "edit:false"

But how about for a custom button ?  That's the portion I am not understanding.

Nathan

03/04/2009
02:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Not quite gffrent

if(edit_right==true) {

$("#mygrid").navButtonAdd(....)

}

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.

11/05/2009
03:37
Avatar
prbabu
Member
Members
Forum Posts: 22
Member Since:
11/05/2009
sp_UserOfflineSmall Offline

tony said:

Hello,

Currently no, but it is easy to add this

Suppose the variable  edit_right  holds the edit rights for the user.

Set it during the opening the page and then

…navGrid(”mypager”,add_right, edit_right…..)

This way the buttons will be created according to the rights.

Regards

Tony


I would like enable/disable the "Add"/"Edit"/"Delete" button on subsequent grid reloads. How to enable/disable them?

-Praveen

13/05/2009
15:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Which version do you refer? Also in 3.5 there is parameter id - where you can add this for the nav button, so you can easy enable and disable. Not available in 3.4.x versions.

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.

14/05/2009
18:47
Avatar
prbabu
Member
Members
Forum Posts: 22
Member Since:
11/05/2009
sp_UserOfflineSmall Offline

That is wonderful!  I am using 3.4.x. I can move to 3.5. But before that can you please give me a quick code sample of how to enable/disable of navigation buttons in 3.5?  Also, is there any specific documentation for 3.5, I can read through?

Regards,

Praveen

15/05/2009
02:55
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Currently no, but if you know the id of the button you can easyshow abnd hide them

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.

15/05/2009
03:23
Avatar
prbabu
Member
Members
Forum Posts: 22
Member Since:
11/05/2009
sp_UserOfflineSmall Offline

I am using the standard Add/Edit/Delete button with the navigator. What is the id. of these buttons?

-Praveen

25/05/2009
20:26
Avatar
prbabu
Member
Members
Forum Posts: 22
Member Since:
11/05/2009
sp_UserOfflineSmall Offline

Found the id. of the buttons using Firebug - great tool !

'Add ' button is "add_list"

'Edit' button is "edit_list"

'Del' button is "del_list"

To hide the buttons one can do this:

                    jQuery('#add_list').hide();
                    jQuery('#edit_list').hide();
                    jQuery('#del_list').hide();

-Praveen

12/11/2014
15:28
Avatar
Vignesh
Member
Members
Forum Posts: 3
Member Since:
12/11/2014
sp_UserOfflineSmall Offline

tony said
Hello,

Currently no, but if you know the id of the button you can easyshow abnd hide them

Regards

Tony

Hi Tony, 

    I have a requirement like, need to enable and disable the Add, Edit, Delete icons in NavGrid dynamically. I can only set the values while loading, and even if i change the value of edit:false in a button click event its not working. Is there any other way? 

19/11/2014
16:07
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

 

The buttons have id. You can either show/hide them by condition or add to them a class ui-state-disabled, which disabled the action too. See the Oleg's post here

 

Regards

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: 496

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