Home > jQuery > jqGrid 3.5

jqGrid 3.5

August 1st, 2009

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

Tags:
  1. August 15th, 2009 at 05:19 | #1

    sorry – forgot to say I’m using v. 3.5.2
    jack

  2. Martin
    August 15th, 2009 at 06:25 | #2

    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

  3. August 15th, 2009 at 17:35 | #3

    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;
    }
    })

  4. Martin
    August 16th, 2009 at 02:06 | #4

    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

  5. Dick
    August 18th, 2009 at 21:36 | #5

    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

  6. Chris Dolan
    August 18th, 2009 at 23:15 | #6

    @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}”

  7. August 18th, 2009 at 23:36 | #7

    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!

  8. Dick
    August 19th, 2009 at 17:10 | #8

    Chris Dolan :@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}”

    @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

  9. Lotte
    August 20th, 2009 at 12:12 | #9

    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?

  10. makro
    August 25th, 2009 at 12:12 | #10

    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

  11. Guramrit Singh
    August 25th, 2009 at 13:14 | #11

    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.

  12. Guramrit Singh
    August 25th, 2009 at 13:22 | #12

    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…

  13. August 25th, 2009 at 23:29 | #13

    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()

  14. user
    August 26th, 2009 at 01:22 | #14

    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 …,

  15. August 26th, 2009 at 11:42 | #15

    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

  16. John
    August 26th, 2009 at 18:16 | #16

    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!!

  17. August 27th, 2009 at 00:03 | #17
  18. August 27th, 2009 at 00:04 | #18

    @user

    one reason might be that the jsgrid plugin (jquery.jqGrid.js) file is not being loaded – use Firebug to check if it is

  19. JR_F
    August 27th, 2009 at 00:26 | #19

    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.

  20. Jagadeesan
    August 27th, 2009 at 08:09 | #20

    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.

  21. Mike Chow
    August 27th, 2009 at 22:54 | #21

    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.

  22. Simply4IT
    August 28th, 2009 at 13:58 | #22

    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

  23. August 28th, 2009 at 16:32 | #23

    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!

  24. ALkyD
    September 3rd, 2009 at 11:17 | #24

    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).

  25. September 4th, 2009 at 15:39 | #25

    Hi,I want to ask that the jqGrid can be use the width with percent just like width:’90%’.

  26. casperd
    September 8th, 2009 at 08:26 | #26

    @Dick
    Hi Dick. Did you manage to find a solution for the accordion problem?

  27. Carlos
    September 8th, 2009 at 14:47 | #27

    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?

  28. Dick
    September 9th, 2009 at 16:17 | #28

    casperd :@Dick Hi Dick. Did you manage to find a solution for the accordion problem?

    @casperd,

    Not until this morning – when I installed 3.5.3. Looking good. How about you?

  29. venubabu
    September 9th, 2009 at 19:16 | #29

    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

  30. Dick
    September 9th, 2009 at 22:27 | #30

    @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.

  31. Dick
    September 15th, 2009 at 21:42 | #31

    @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!

  32. casperd
    September 16th, 2009 at 11:49 | #32

    @Dick
    Hey Dick. Nope, I still have the same issue. Did you do anyhting else after installing 3.5.3?

  33. satou
    September 16th, 2009 at 12:28 | #33

    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

  34. Dick
    September 16th, 2009 at 16:49 | #34

    @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.

  35. Dick
    September 16th, 2009 at 19:24 | #35

    @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.

  36. Carlos
    September 17th, 2009 at 19:46 | #36

    @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;
    }

  37. Rayson
    September 18th, 2009 at 07:49 | #37

    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.

  38. September 18th, 2009 at 20:34 | #38

    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 🙂

  39. satou
    September 19th, 2009 at 08:21 | #39

    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;}

  40. Mark Alan Evans
    September 24th, 2009 at 07:16 | #40

    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!

  41. September 25th, 2009 at 09:01 | #41

    Hi .
    I am trying to use JQgrid with JSp.. can you please guide me. how to use it?

  42. October 1st, 2009 at 09:30 | #42

    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

  43. October 6th, 2009 at 21:42 | #43

    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.

  44. Swetlana
    October 7th, 2009 at 09:45 | #44

    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.

  45. Bart
    October 8th, 2009 at 13:30 | #45

    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.

  46. nish
    October 8th, 2009 at 15:30 | #46

    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.

  47. nish
    October 8th, 2009 at 15:31 | #47

    nish :
    HiTony,
    Really a nice plugin.I have one problem with Find button of search option.In my example find button is not working.Can you guide me.

  48. tony
    October 8th, 2009 at 19:15 | #48

    @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.

  49. tony
    October 8th, 2009 at 19:21 | #49

    @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?

Comment pages
Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information