Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






custom buttons: how to remove them

No Tags
UserPost

16:34
04/12/2009


stefan.livens

Member

posts 12

Hi,


First, thank you for this wonderfull component.


Now I have a question: How do I remove custom buttons from the navigator (the pager)?

I add them like this:

$("#org_tree").jqGrid({
    ...
})
.jqGrid("navGrid","#tree_pager",{edit:false,add:false,del:false,search:false,refresh:false})
.jqGrid("navButtonAdd","#tree_pager",{
        onClickButton:switchTree,caption:"Show Full Tree"
    }
);

Now this is my function switchTree:

function switchTree(){
    $("#org_tree")
        .setGridParam({url:"../dev/org1.json",page:1})
        .trigger("reloadGrid")
        .jqGrid("navButtonAdd","#tree_pager",{
                onClickButton:switchTree2,caption:"Show My Tree"
            });
}

This function adds the button, so I have 2 buttons , now how can I replace the button "show full tree" with the button "show my tree"?


thanks in advance.

15:44
05/12/2009


tony

Sofia, Bulgaria

Moderator

posts 7375

Hello,

When created this way every button has a uniquie id (or you can give them one).

If know this Id it is easy to manipulate.

http://www.trirand.com/jqgridw…..om_buttons

Regards

Tony

For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site – trirand.net – by the very same guys that created jqGrid.

11:05
08/12/2009


stefan.livens

Member

posts 12

Thanks Tony.

I must admit, I overlooked this optional id you can set when creating these buttons.


(just for future reference, like this:

.jqGrid("navButtonAdd","#tree_pager",{
                onClickButton:switchTree,caption:"Show Full Tree" ,id:"tree_button"
            });


Maybe we can add it in the "discussion" section of that wiki page?

Thanks again.

18:32
08/12/2009


tony

Sofia, Bulgaria

Moderator

posts 7375

Hello,

Thanks. Any usefull addition into the documentation is welcome.

Best Regards

Tony

For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site – trirand.net – by the very same guys that created jqGrid.

No Tags

About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

215


Currently Online:

46 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 10271

Posts: 30349

Membership:

There are 11036 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1210

markw65 – 179

kobruleht – 144

phicarre – 132

YamilBracho – 124

Renso – 118

Administrators: admin (60 Posts)

Moderators: tony (7375 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information