If you're going to be posting JSON you're probably better of using a custom data function like this..
setup your grid with the datatype option set as
datatype : function(pdata) { getData(pdata); }
and here is the function…. note the params object which is what i send JSONified to my webservice… which can be anything you want… and in my case the data that gets sent is…
{"page":1,"pageSize":25,"sortIndex":"id","sortDirection":"desc"}
see how they match my “params” object …
I dont want to have to define the order of the columns in the data service. I think that it is better that the grid determines the order of columns. Because I cannot seem to figure out how to get jqGrid to do this I have decided to use the 'postData' attribute to pass back a list of columns in the order that I want. The service then uses this list to sort the columns. Its not the optimum way to do it but its better than hardcoding the column order in the service itself.
If there is some other way to achieve this I would like to know.
Well I would change the order of the items in the colModel.
Dear Tony,
It's OK to save the existing value (e.g. “0″ in the sample). However the grid tries to save the whole html text string into my boolean field.
Best regards,
Rayson
Hi..
ok, i got it working with the samples from riverguardian. but i have a problem with the id…..i have table column with the name id too and this column is shown as “ID” in the grid….when i load the data via json everything is fine. the row with the id 3 is shown as first row in the grid with value 3 in id cell. when i edit the data id=1 is send to the edit.php, so its saving to the wrong row. how can i send the correct identifier to the edit.php?
Coming form the C# and Java world and being new to Javascript I am amazed at the richness of fucntionality and good looks of the grid. Everything works great for me, except one problem, exactly the same as reported here. For me this happens only in IE and only on a first load after the browser stratup. Subseqent loads work fine.
As you requested, I posted the code at
But there are so many include files that it's impossible to actually view the document.
Hi,
I have the same problem too.
I ture on the scrollrows and use setSelection.
the row was
redsuitee said:
maybe u can try this one:
hiddengrid:true
Hey there
If you don't include the Caption parameter in the decleration of the grid there won't be a Caption bar…
Dear Tony,
I tried modify setLabel in grid.base.js (line 1793) by changing
Dear Tony,
You are right, the DOCTYPE definition really fixed it. Thanks a lot!
Best regards,
Rayson
I read about that options, but it is for posting data to the server. What I mean in my previous post is the ability to include unescaped content in a cell. For example, suppose that your server side script returns a string like alert('hello world'), when your jqgrid is rendered the script is executed.
At this time, the only way to prevent such similar xss is to escape datas server side, or using a custom formatter, but this would mean that you can not use any other formatter for that cell.
Bye.
P.S. I'm trying to extend standard formatters by writing some other functions. I'd like to make something like extending that object, in this way I simply have to include my file and use my formatter in the same way of the bultin ones. One problem, I'm not very skilled with javascript, can somone help me with a link to some doc?
Thanks for help 🙂
This plugin is one of the best that I found
One more question, it is an option to export data displayed to csv or xls in PHP?
Rojoba:
Could You please put an example of what do you do for put ther dirty-class
Thanks
rojoba said:
Hi Tony
Thanks. Yes I inspected the html at the time and I ended up playing with the classes to do what I needed for a new row. Also, the
had to have an “edited” class (i think) for the getChangedCells('all') method to pick up the new row id. Thanks again for the response.
Kind regards,
Roger
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top