I agree with fen. I have also some situation where wither width or height was wrong calculated. So I have to write a small fix. In http://stackoverflow.com/questions/2686043/correctly-calling-setgridwidth-on-a-jqgrid-inside-a-jqueryui-dialog/2696776#2696776 I posted this code.
With the height of jqGrid I have problem only in IE6. Mostly if my grid should has a horizontal scrolling its height was exactly one row too low.
With the width of jqGrid I have problems in following situation:
I have a block element (div) which tooks allways 100% or 98% of the page width. jqGrid is the child element of such block. I prefer to have no scrolling in the grid if parent block allow this. In my cases the width of all columns were allways exactly 5px too less as needed I one has horizontal scrolling which not needed. It seems a bug.
Other problem: the grid size which will be calculated by jqGrid can be set to the size larger as the parent block element (div). I verify whether the situation take place and then if needed reduce the jqGrid width. So user can scroll inside of the page, but he needs not scroll the page. (Horizontal scroll bar will have jqGrid abd not the web page).
Best regards
Oleg
Hello Tony!
I tested the current version from GitHub and found till now only one small problem.
I have one Grid where a column has formatter: 'showlink'. The data send from server have sometime null values. Previous version on jqGrid formated this value like an empty string. The current version from GitHub instead format 'null' value like clickable null. It seems to me that the line 235
cellval = cellval+"";
shortly added inside of $.fn.fmatter.showlink function in the file jquery.fmatter.js should be removed. At least I don't undestand it's meaning.
Now you undestand, that working with JSLint tooks not so little fime. I hope you will not regret, that begin modifing of jqGrid corresponds of JSLint recomendations.
Inspide of large number of changes in jqGrid I found, that some bugs is not yet changed. For example, the line 160 of grid.custom.js looks the same as before:
if($t.p.footerrow) { $(".ui-jqgrid-sdiv","#gbox_"+$s.p.id).slideUp("fast"); }
but it should be fixed to
if($t.p.footerrow) { $(".ui-jqgrid-sdiv","#gbox_"+$t.p.id).slideUp("fast"); }
One more clear bug, which I described befor (see /blog/?page_id=393/bugs/more-bug-fixes-and-other-suggestions-found-with-respect-of-jslint-tool/) is in the lines 203-204 of grid.jqueryui.js. The code
if (opts.classname) {
Hello Tony!
My main goal was to show you, that the usage of JSLint can be really very helpful. So it would be good if you include JSLint in the process of the future release builds of jqGrid.
I also think (like you) that one should be very careful if one makes a lot of changes in a working code. But nevertheless please don’t forget to fix some clear bugs which I described in my two posts: like usage $s or ts instead of $t in grid.custom.js (see /blog/?page_id=393/bugs/more-bug-fixes-and-other-suggestions-found-with-respect-of-jslint-tool/) or missing “var” declarations. (Otherwise I had spend a lot of my time for nothing)
One more remark: I war at the beginning much more careful with changes of the “Equal” and “Not Equal” operators (“==” and “!==”) to “Identically Equal” and “Not Identically Equal” (“===” and “!===”), which makes comparison without any type conversion.
Hello Tony,
I add here some more LS Lint suggestions which I forgot to include in my first post.
In the file grid.base.js in the line 713 are used function IntNum which should be better renamed to intNum. The function with the first capital letter in the name looks like more as a name of a class.
Assignment in the line 967 looks a little strange because of “+=”:
Hello Tony,
now some suggestions to improve grid.common.js:
Replace the line 234
Hello Tony,
with the line “if (p.gridComplete = complete) {” I was not sure myself.
If you want I could check other jqGrid-files (not only grid.base.js) when I found a little time for it.
Regards
Oleg
Hello casperd,
I want to supplement Tony’s answer.
If you use the newest version of jqGrid from http://github.com/tonytomov/jqGrid for the documentation of the setLable() parameters) and with the code like
Hello jayflexrich!
Probably you forgot to save your html file in UTF-8 fomat. It is not enough to have . You have to encode the file also in UTF-8 format. If you open for example the html file with notepad.exe (under Windows) and save it with “Save As” and then choose UTF-8 encoding option (bottom, in the middle).
Best regards
Oleg
P.S. If file encoding is not your problem, I'll post a simple code or will place it a one page on my web.
Hello jayflexrich!
It seems to me, that you have not a problem of with jqGrid, but you need place in your html page character encoding information. (something like )
Best regards
Oleg
Hello twaldron,
if you really want to have date as a parameter of your conctoller, then you need at least modify url parameter of the jqGrid from
“DealerServices/JsonScheduledSpas/” to some with the date inside of url. Then you need add coresponding template in you MVC application which difines from which part of url the date should be fiiled.
Best regards
Oleg
Ohhh. This question is really not for the jqGrid forum! But you can fill city-table based on SQL statement like
SELECT
Sorry you write about inline editing. In inline editing you edit the whole row. dataUrl in the editoptions of a the field of the “edittype: 'select'” will be used to construct the list of values in the combo box display if one clicks in the corresponding cell. What do you want exactly? Do you have more then one cells with “edittype: 'select'” in every row and you want modify dataUrl of one cell based on the select results of another cell of the same row during inline editing of the row? If it is what you want, the answer on your question you'll find in /blog/?page_id=393/help/dynamically-populate-select-dropdown/. Using dataEvents of the type: 'change'” on one cell can give you a good place to change dataUrl of your second select-field.
Or you want do something different?
It's very easy. Inside of ondblClickRow or onSelectRow (where you plan to call editRow) you can with additional parameters:
grid.editRow(id, true, null, null, urlEdit + '/' + id, …);
If you need more data from the selected row, you can call
var rowdata = grid.getRowData(id);
and then construct url of editRow based on rowdata.
Best regards
Oleg
It's depend on how you implemanted your master/detail example. The natural way could be place in the country grid onSelectRow event. In the event handle you could change some parameters of details grid (city grid) like title, url with respect of setCaption, setGridParam or some other methods. Then you call trigger(“reloadGrid”) on details grid. You can also use getRowData inside of event handle to get all information from selected master row.
All logic about reading latitude/longitude from the parent (country) can do your server.
If you don't have any server part of your program, you could do all works in javascript also.
I recommend look at http://trirand.com/blog/jqgrid/jqgrid.html choose Advanced and “Master Detail”.
Best rebards
Oleg
setLabel and setRowData methods could help you. See /jqgridwiki/doku.php?id=wiki:methods. If you set title attribute you can also change tooltip of the cell or column header.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top