jqGrid 3.5
jqGrid 3.5 finally is released.
First of all I want to Thank you all people that participate on this project with invaluable comments and contributions.
I have started new project jqGrid Wiki
The purpose of this project is easy to update the Documentation and the most important part – I have added a HAWTO Sections under every Documentation Chapter. Here we will add all the things that we have discussed and resolved in the Forum.
Since my primary language is not English I want to apologize for the errors in the Documentation, but I hope that with your help we make it better and better.
The registration in the jqGrid Wiki is free so feel free to correct errors and make additions in the Documentation.
(Note – the account on the jqGrid Wiki and the blog are not synchronized – sorry. Any attempt to do this ends with not working wiki.)
For all bug fix releases and updates of 3.5 version please, check the Wiki page
Enjoy
sorry – forgot to say I’m using v. 3.5.2
jack
Hi Tony, any thoughts on dataURL cause 404s?
dataUrl:’/index.php/EventController/regionlist’}, generates a GET it seems, when I’d like a post. /index.php/EventController/regionlist?_nsd=1234456
Thx
Martin
I have a problem.
Selects in edit form don’t show value from grid. After dialog opens its select index always 0.(jqgrid3.5.2 Firefox 3 and IE7)
var linesConfigs=[
{name:’Canal’,label:’Ðомер’,width:50},
{name:’State’,label:’СоÑтоÑние’,editable:true, edittype:’select’, editoptions:{value:{0:”OFF”,1:”PM”,2:”ON”}}},
{name:’MyCanelNameEN’,label:’Имђ,width:70,editable:true,editoptions:{‘size’:3},formoptions:{elmsuffix:”Обозначение канала” } },
{name:’MyAddressEN’,label:’Ðаш адређ,editable:true,editoptions:{‘size’:8}},
{name:’PeerAddressEN’,label:’Ð°Ð´Ñ€ÐµÑ Ð¦ÐšÐ¡’,editable:true,editoptions:{‘size’:8}},
{name:’Device’,label:’Порт’,width:80,editable:true},
{name:’PortType’,label:’Тип уÑтройÑтва’,hidden:true,editable:true,editrules: {edithidden:true}, edittype:’select’, editoptions:{value:”MTA:Телеграфф;COM:Модем”}},
{name:’RuProtocol’,label:’Язык протокола’,hidden:true,editable:true,editrules: {edithidden:true}, edittype:’select’, editoptions:{value:”0:ÐнглийÑкий;1:РуÑÑкий”}} ]
$(“#lines_tab”).jqGrid({
url:’lines.php?f=get’,
editurl:’lines.php?f=edit’,
datatype: “json”,
width:700,
colModel:linesConfigs,
// rowNum:5,
// pager: $(‘#lines_page’),
sortname: ‘Canal’,
jsonReader: { repeatitems : false, id: “0” },
viewrecords: true,
//sortorder: “desc”,
caption: “Линии ÑвÑзи”,
//loadonce: true,
loadError:function(xhr,st,err){
alert(st+’:’+err+’:’+xhr.responseText);
},
onSelectRow:function(id){
//alert(id);
// jQuery(“#lines_tab”).
lineUpadeInfo();
}
}
)
For now I use this hack on my js:
beforeShowForm1:function(id){
$.each(linesConfigs,function(k,v){
if(v.edittype==’select’)
{
$(‘#’+v.name+’ > [value=’+tab.getCell(gr,v.name)+’]’,id).get()[0].selected=true;
}
})
Hi Tony, sorry to be a pain, but here’s another issue related to the edit box & selects.
It seems that the select doesn’t remember the selected value.
1) Open edit – no checkboxes set (as reported previously)
2) Close edit
3) Open edit – checkboxes set correctly, select not set correctly.
Thanks
Martin
Tony, @CasperD
I’m still seeing the “Loading” box (though it is empty) on the grid when it is in the 2nd, 3rd, 4th, etc. UI Tab i.e. the border is visible, but the Loading text is gone. CasperD is apparently still having the problem with Accordian too, though he is using 3.5.1 and I’m using 3.5.2.
Thanks, Dick
@jack_s
I had this (or a similar) problem (the page and record counts were not showing up), and it had to do with me setting my own pgtext and recordtext values, which are now formatted fields. The default values are:
recordtext: “View {0} – {1} of {2}”
pgtext: “Page {0} of {1}”
hi tony, I like the way the custom unformat works now in 3.5.2 – it appears that jqgrid is saving a copy of the original content of each cell and sending that to the Edit form.
Essentially all i need to do in my custom unformat function is to return the cellvalue parameter. Right?
Thanks for the fix. Very Nice!
@Chris Dolan,
The “recordtext” formatted text is fine and the first parameter of the “pgtext” is fine, but the 2nd parameter value does not display, though it did pre-3.5. For example, it now displays “Page 2 of “.
Dick
Hi Tony,
I’m trying to get celledit to work with checkboxes. Currently I have the following colmodel for a field:
{ name:’prioritize’, index:’prioritize’, editable: true, edittype: ‘checkbox’,
formatter: ‘checkbox’, editoptions: {value:”1:0″}}
I have set checkbox:{disabled:false} in the formatter and I can indeed check or uncheck the boxes in the grid. However, I want the grid to save my cell as soon as the checkbox toggles.
Since the onCellSelect event is disabled when using inline cell editing, I’m trying to use the beforeEditCell function for this. I got the following:
beforeEditCell: function(rowid, cellname, value, iRow, iCol) {
if(cellname == ‘prioritize’) {
$(‘tetecGrid’).saveCell(iRow, iCol);
}
},
but the cell won’t save since this event is apparently fired after the checkbox has already been toggled. When I debug the code with Firebug, I can see that the new value is equal to the old value so it will skip the save:
// The common approach is if nothing changed do not do anything
if (v2 != $t.p.savedRow[fr].v)…
Is there any other event I should use so the checkbox saves as soon as it gets changed?
Hi Tony.
I’m using latest jqGrid (3.5.2) and I’m using editGridRow method inside a modal ui-dialog.
I’ve set the edit form z-index to 2000 in order to bring the edit form to top.
It works but I can’t write into any fields at all!
If ui-dialog isn’t modal fields are writable…
Can U help me, please?
Thanks in advance,
Marco
Theme switcher is commented in jQGrid Demo Site… Please uncomment it…
In downloded examples, It works amazingly… Thanx for lot of work. This version is great, It should be the part of jQuery UI.
I want to suggest some additions:
->There should be a function to select all rows, I tried to do it myself, but with some bugs,
–> By traversing and selecting rows, it was time consuming
–> By setting the attr of multiselect checkbox to checked, and raising click event, It worked, but with bugs
-> In Remote data mode, checked rows state should be persisted while paging, sorting etc., I did it by storing selarrow in local variable, and reselecting rows on gridComplete.
Thanx…
just out of curiosity, can you take a preexisting table and just apply the jqgrid to it?
data item1
data item2
data item3
data item4
$(“#sometable”).jqGrid()
hey tell me why is so damned hard just to make a static page that shows a grid of local array data as it is showed in the demo,
i keep stumbled at
Error: jQuery(“#list4”).jqGrid is not a function
WTF is this …,
It seems that loadonce attribute doesn’t work when I use for datatype function parameter…details: http://stackoverflow.com/questions/1329002/jqgrid-loadonce-doesnt-work-with-asp-net
Is there a method for disabling the grid? For example, I am disabling a grid while a ‘grid as subgrid’ is loading. I want to disable the parent grid while the child grid is loading.
What i’ve done is in the ‘beforeRequest’ event of the subgrid, I execute:
$(“#lui_GridID”).show();
and then in ‘loadComplete’:
$(“#lui_GridID”).hide();
And it works well. However, it would be extremely helpful if jqGrid was implemented as a jQuery UI widget. The default functions like $(‘widget’).disable() would be very useful, and much could be gained in terms of making jqGrid widely available to people. It seems to be the direction this project is heading with adoption of the theming. After having authored my own widgets, and looking through the jqGrid code, it would probably be a major release for jqGrid. So, are there plans for jqGrid 4 to have jqGrid as a widget?
Also (most importantly) Thank you for your excellent work!!
@james lee
yes! Here’s a link to some docs: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:table_to_jqgrid
@user
one reason might be that the jsgrid plugin (jquery.jqGrid.js) file is not being loaded – use Firebug to check if it is
3.5 is great! Any plans to allow more complex entries – like expressions – in the multiple toolbar search? For example:
– in a numeric column, allow an expression like “< 700"
– in a text column, allow an expression like "like 'abc*'
– in a date column, allow "between 01/01/2009 and 06/01/2009"
The multiple toolbar search is nice but it can only be used for very simplistic searches, from what I can tell.
Tony,
Is it possible to make the formEdit Modal not to close when I click outside? Typically, we have some time consuming process on submitting the form, and restrict the user to close the Modal until it completes.
Please advise.
Hi Tony,
Many thanks for your great work on this plugin. It’s really fantastic!
One minor issue I’d like to mention is:
when I use the “Integrated Search Toolbar” (filterToolbar), it doesn’t allow me to select the text entered in the toolbar (IE only, works well with Firefox). Do you have plan to fix it?
Thank you.
Hi Tony,
thank you for your great work. It saves a huge amount of time for everybody. It is a very good stuff.
There is small a problem with applying the closeAfterEdit parameter to a navGrid.
If you add the afterSubmit trigger to a grid, it is working fine as it supposed to work.
xxxxxx.navGrid(‘#gridId’,{edit:true,add:true,del:false}, {afterSubmit:function(response, postdata){
success = false;
message=”Unsuccessful update”;
return [success,message]
}});
But if you add this as well:
{closeAfterEdit: true}
xxxxxx.navGrid(‘#gridId’,{edit:true,add:true,del:false}, {closeAfterEdit: true}, {afterSubmit:function(response, postdata){
success = false;
message=”Unsuccessful update”;
return [success,message]
}});
After that on (true) success the modal dialog will be closed, which is fine, but it will get closed even if the success parameter is false. So no error message showing at all.)
If you set closeAfterEdit to false: {closeAfterEdit: false}. Then it won’t close the dialog, but it won’t show any error message neither on false “success”.
Does it behaving the same way for you? I am using jQuery v1.3.2, and jqDialog 3.5
Hi,
First I’d like to say thanks for a cool plugin. It works and look very similar to the ExtJS grid that I’ve used in the past.
During implementation we discovered an issue where the grid formatter (and other methods) seems to crash if you return a JSON set with more columns than are defined in the colModel.
Just thought you should know! Thanks!
Hello,
I would like to know how, in a cell, words which have reached the end of the cell return automatically to a new line. For example, if a sentence is too long and doesn’t have ” or ‘\n’, the sentence is cut if cell is not enough large. This is similar with a div which have css properties “white-space: nowrap; and “overflow: hidden”.
Thanks for answers (sorry for bad english).
Hi,I want to ask that the jqGrid can be use the width with percent just like width:’90%’.
@Dick
Hi Dick. Did you manage to find a solution for the accordion problem?
My question is the same as ALkyD’s question. Is there a way to get the grid to automatically do a carriege return if the text is too long for the cell?
@casperd,
Not until this morning – when I installed 3.5.3. Looking good. How about you?
I was trying to grid in asp.net mvc application.
The grids works fine, when you use in home controller and index view.
When I moved same code to different controller it is not working.
what is the issue?
Here is the error
The parameters dictionary contains a null entry for parameter ‘page’ of non-nullable type ‘System.Int32’ for method ‘System.Web.Mvc.ActionResult GridData(System.String, System.String, Int32, Int32)’ in ‘AApp.Controllers.IdentityManagementXvalController’. To make a parameter optional its type should be either a reference type or a Nullable type.
Parameter name: parameters
@venubabu
If you have JQGrid working in the home controller and the index view, it’s not a JQGrid issue.
Put JQGrid aside for now and get your view loading with the new controller. Your Controller, View, Global.asax, etc. all have to be in sync. “ASP.NET MVC 1.0” is an excellent book which will help you to understand how the pieces fit.
@Tony,
There is a low-priority bug related to Search closeOnEscape. It works fine on Tab1, but not on Tab2, Tab3, etc.
Thanks for all you do. You are amazing!
@Dick
Hey Dick. Nope, I still have the same issue. Did you do anyhting else after installing 3.5.3?
Hi. I found one problem when editting grid.
When colModel options are
– edittype : select
– editoptions : {multiple : true}
listbox selection is only one even if select multi items.
So, to resolve that problem, I added below code at grid.common.js, about 270 lines.
elem = document.createElement(“select”);
var msl = options.multiple===true ? true : false;
if(msl) elem.multiple = true; // <— added by me
Maybe, multiple attribute must be added BEFORE calling appendChild.
I'm glad for you to merge above code in next version.
Bye
@Tony,
Cosmetic issue: In the navigator where you have “Page 1 of 20”, the area is a little small. For very small tables it works, but for large tables the total pages disappears and you get only “Page 1 of”.
Thanks.
@Tony,
Another interesting bug:
If I use the following to setup a search, The closeOnEscape doesn’t work on Tab2, Tab3, etc. as noted above, but the “Loading” text and box work correctly on Tab2 and Tab3:
jQuery(“#subtask”).searchGrid(
{ multipleSearch: false,
closeAfterSearch: true,
closeOnEscape: true,
drag: true
}
If I use the following, the “Loading” box doesn’t go away on Tab2, Tab3, etc:
}).navGrid(‘#psubtask’,
{ add: false, edit: false, del: false, search: true, refresh: true } //,
{}, // edit options
{}, // add options
{}, //del options
{multipleSearch: false, closeAfterSearch: true, closeOnEscape: true, drag: true} // search options
);
The “Loading” text is gone leaving the empty box.
@ALkyD
The way I got around this was to replace the following section in the grid.css file:
table.scroll tbody tr td {
font-size: 9pt;
padding: 2px;
text-align: left;
border-left: 1px solid #000;
border-bottom: 1px solid #000;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
height : auto;
}
With this:
table.scroll tbody tr td {
font-size: 9pt;
padding: 2px;
text-align: left;
border-left: 1px solid #000;
border-bottom: 1px solid #000;
text-overflow: none;
overflow:auto;
white-space:normal;
height : auto;
}
Dear Tony,
I load data using json from database. One of the column is inserted by manupulating data from other columns. When I click on the column heading to sort, all records gone. How can I make this column to be sorted locally?
Thanks for your help.
Search filer – filterGrid – view error – table is going crazy when heaving more then 10 cells.
In file grid.custom.js on line 503 there should be “cellspacing=’1′”
var tbl =$(“”);
After the change everything is all right 🙂
I found another problem.
In grid.base.js around at line 424 and line 530, comparison expression between record count and counter is wrong.
if( rn !=-1 && ir>rn) {break;}
=> if( rn !=-1 && ir>=rn) {break;}
So far the grid is really awesome! it has been a life saver!
Just wondering if you had seen this post: http://www.nshaw.com/2009/01/jqgrid-and-aspnet-web-forms-with-json.html
i really wish i could set the content type, as my project expects the data to be of a certain content type, and i have to create a separate way to get the data.
Is there a place better for suggestions?
Thanks so much!
Hi .
I am trying to use JQgrid with JSp.. can you please guide me. how to use it?
Hi Tony,
Really great job.
I only have one problem…I use search toolbar.
I have 5 columns.
If I do a search and then i press clear toolbar My controller gets the old search parameters.
As I can imagine its only clears the textfields.
Can you please provide me a solution?
Thanks you at all.
Kostis
Great job you’re doing with this plugin… it has really helped me improving my web apps, but the more I use it, the more I realize that the greatest drawback is the speed… even though this issue has already been adressed.
Good afternoon!
Please, look at a demo-page http://www.trirand.com/jqgrid/jqgrid.html
New in version 3.5 / Form Improvements:
If the field “Notes” contains long record it will be cut off in a mode “View selected row”.
How it can be corrected?
All kind and thanks for your work.
Hi,
thank you for this fantastic jq plug-in.
I’m using the very useful “scroll paging feature”, that advance to the next page when the user drag the scroll bar to the bottom.
I want to know if is possible to modify slightly this behaviour: i need that a new page is loaded when the scroll bar is “near the bottom”, not when it reach completely the bottom.
A similar thing happens with gooogle reader, it load new contents where the scrollbar reach about 75%.
Regards.
HiTony,
Really a nice plugin.I have one problem with Find button of search option.In my example search button is not working.Ca you guide me.
@nish
What do you mean with not working? Please be a more concrete and posting code or link for the problem is very helpful. Also there was a bug in IE6 IE7 which is corrected in GitHub.
@Bart
This feature is in the todo list of 3.7 version.
@Swetlana
Thanks. The bug is fixed in GitHub – 3.6 branch.
@epp687
Thanks this bug is fixed. Please use the 3.5.3 release.
@director
Sorry I can help with JSP.
@Mark Alan Evans
The upcoming 3.6 will do this. The beta is expected after a week.
@Satu
This is not a bug. Please check your server response if all is correct.
@Rayson
If I remember there is a such post in the forum
@Dick
Which version do you use exactly?
@satou
Thank you very much. Fixed in GitHub – 3.6 branch.
@Dick
Could you please send me alink to the problem or use by example jsbin to post the full code?