How to add extra view button & right click menu

QuestionsHow to add extra view button & right click menu
Sanchit asked 11 years ago

hello,
i want to add "view" button which gives me the id of selected row,
i also want to add right click menu with few options.

can you please help me how can i add these two options.

1 Answers
Abu Ghufran answered 11 years ago

Following JS will get the id of row:

// returns null if no row is selected OR id of row (single row)
var selr = jQuery('#list1').jqGrid('getGridParam','selrow');

To add row wise button, follow this example:

# Custom made column to show link, must have default value as it's not db driven
$col = array();
$col["title"] = "Details";
$col["name"] = "more_options";
$col["width"] = "30";
$col["align"] = "center";
$col["search"] = false;
$col["sortable"] = false;

# no new line in this html, only space. otherwise it may break ui of grid
$buttons_html = "<input type='button' value='View' onclick=''alert('my-js');";
$col["default"] = $buttons_html;
$cols[] = $col;

For toolbar button, refer demos/appearence/toolbar-button.php

If using free version, these demos are provided with license build.

Your Answer

3 + 7 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?