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

trying to replicate demo_app w Rails3 #1

Open
ghost opened this issue Jul 21, 2010 · 2 comments
Open

trying to replicate demo_app w Rails3 #1

ghost opened this issue Jul 21, 2010 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 21, 2010

I tried to rebuild the app for Rails 3..
when running : http://localhost:3000/users/
I get the following page displayed ( all scripts are displayed like text...)

  1. Simple DataGrid
    <script type="text/javascript"> var lastsel; jQuery(document).ready(function(){ var mygrid = jQuery("#players").jqGrid({ url:'/users?q=1', editurl:'', datatype: "json", colNames:['ID','Pseudo','Firstname','Lastname','Email','Role'], colModel:[{name:'id', index:'id',width:35,resizable:false},{name:'pseudo', index:'pseudo'},{name:'firstname', index:'firstname'},{name:'lastname', index:'lastname'},{name:'email', index:'email'},{name:'role', index:'role'}], pager: '#players_pager', rowNum:10, rowList:[10,25,50,100], imgpath: '/images/jqgrid', sortname: '', viewrecords: true, height: 150, sortorder: '', gridview: false, scrollrows: true, autowidth: false, rownumbers: false, multiselect: false, subGrid:false, caption: "Football Players" }) .navGrid('#players_pager', {edit:false,add:false,del:false,search:false,refresh:true}, {afterSubmit:function(r,data){return true;(r,data,'edit');}}, {afterSubmit:function(r,data){return true;(r,data,'add');}}, {afterSubmit:function(r,data){return true;(r,data,'delete');}} ) .navButtonAdd("#players_pager",{caption:"",title:"Toggle Search Toolbar", buttonicon :'ui-icon-search', onClickButton:function(){ mygrid[0].toggleToolbar() } }) mygrid.filterToolbar();mygrid[0].toggleToolbar() }); </script>
    </div>
    ...
@freewheeling
Copy link

In case anyone else comes across this problem - Rails 3 now html encodes output by default. You have to explicitly override that default behaviour using raw(), so instead of your view containing:

<%= jqgrid(...) %>

It should be

<%= raw(jqgrid(...)) %>

@manisyb
Copy link

manisyb commented Sep 14, 2011

I tried to run this application in rails 3.0.10 ...
I couldnt display any grid in my index page ...
<%=jqgrid_javascripts%>
<%=jqgrid_stylesheets%>

I have used these 2 lines in my layouts/application.rb file
i hope problem on this place only ....

plz anyone help me out from this problem ...
Thanks in advance....

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

2 participants