Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit, Show, Delete button with links to rails views #17

Open
phlegx opened this issue Aug 26, 2010 · 1 comment
Open

Edit, Show, Delete button with links to rails views #17

phlegx opened this issue Aug 26, 2010 · 1 comment

Comments

@phlegx
Copy link

phlegx commented Aug 26, 2010

Some suggestions:

  • add custom actions (e.g. edit and delete button on every column with edit and delete link) this for example if one want to use the edit form of rails e.g. /users/1/edit and not the inline edit.
  • equal for "new user"
  • it is possible to add some code lines to the plugin to add this functionalities?
  • here an example: http://www.trirand.com/blog/jqgrid/jqgrid.html on "Row Editing" -> "Custom Editing"

Cheers

@ghost
Copy link

ghost commented Dec 3, 2010

see i.e. the fork: https://github.com/vrish88/2dc_jqgrid

add in the 2dc_jqgrid.rb
grid_complete = ""
if options[:grid_complete].present?
grid_complete = %Q/
gridComplete: function(){
#{options[:grid_complete]}();
},
/
end

and add additional to "Generate required Javascript" (line number 253)
#{grid_complete}

in the application.js

function grid_complete() {
var ids = jQuery("#example_jqgrid").jqGrid('getDataIDs');
for(var i=0;i < ids.length;i++) {
var cl = ids[i];
show = "Show"
jQuery("#example_jqgrid").jqGrid('setRowData',ids[i],{
act: show
}
);
}
}

add in the view file (index.html.erb)

<%= raw(
jqgrid("Test", "example_jqgrid", "/controlleryxz",
[
{ :field => "id", :label => "Id", :width => 35, :resizable => false },
{ :field => "act", :label => "Actions" },
],
{ :grid_complete => "grid_complete" }
)) %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant