Forum


14:02

26/01/2010

Hi
On selectRow, i want to get the value of a certain column in that row only when the row is selected and use thatvalue to update another element.
As stated in the wiki /jqgridwiki/doku.php?id=wiki:methods
It urges you not to use getCell or getRowData as that does not return the value:
Do not use this method when you editing the row or cell. This will return the cell content and not the actuall value of the input element.
So What are my options for getting this to work?
I was thinking about
var id = jQuery("#"+gridName).jqGrid('getGridParam','selrow');
var rowData = jQuery("#"+gridName).jqGrid('getRowData',id);//data of the row
var cellValueRfiNo = rowData.rfiLog.rfiNumber
But this doesnt work! (my column name is rfiLog.rfiNumber)
any ideas? thanks!
20:06

Moderators
30/10/2007

Hello,
Could you please post the colModel, or better the entrie grid configuration.
Using FireBug you can easy determine what you have in rowData , just put this
console.log(rowData);
after the call and just look into the console how your rowData look.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
22:49

26/01/2010

Sometimes when I use console.log I get an error saying: console is not define. anyone know why?
However sometimes it does work.
When I console.log(rowData).. I get as follows for my columns..
genericLogDocument.description "my description"
genericLogDocument.genericNumber "190"
rn "1"
When I console.log(rowData.genericLogDocument.genericNumber); I get this error: rowData.genericLogDocument is undefined
However if I console.log(rn) It prints out correctly .. in this case as 1.
It seems that the columns that are defined with a name like in this case genericLogDocument.genericNumber
<sj:gridColumn name="genericLogDocument.genericNumber" index="genericLogDocumentNumberHeader"
I can!t get the value.
GenericLogDocument is an object which has an attribute genericNumber.
any thoughts on this? Thanks.
13:09

Moderators
30/10/2007

Hello
Try to obtain the value this way
var cellValueRfiNo = rowData["rfiLog.rfiNumber"];
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
00:45

26/01/2010

I tried your suggestion with another grid and what is alerted is not the data value but the actual make up for the cell contents
var cellValue = rowData["documentDistributor.companyName"];
alert(cellValue)... shows.....
<input class="editable" name="documentDistributor.companyName" id="2_documentDistributor.companyName" maxlength="50" size="50" type="text">
any further suggestion? :-)... Its driving me nuts!..
13:49

Moderators
30/10/2007

Hello,
If you look at you first post there is a text with red. This is what we mean .
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
20:00

Moderators
30/10/2007

Hello,
For me will be quiete easy if you explain me what you want to do.
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
12:15

01/04/2010

Hi guys,
I have nearly the same problem. I have a JQGrid where you can change a field in Cell Editing Mode. All is working fine. If a user now change the value in inline mode and take a click on the change button on the table (for Formediting-Mode), getRowData gave me (yes I know it stands in the documentation) the html input field. But what alternative I have?
Additionaly if a user change in celleditingmode the value and click an another row or cell that is not editable I want to display the new value in a html div block out of the jqgrid. So I have two functions formatCell and onSelectCell. Both do the same take the getRowData and display it in the div block. Same Problem I know the documentation but what is the alternative? If I use a hidden value the value would not be updated.
Any ideas Tony? Is there a changse to do something like Column-Editing to make a column editable? So I can ignore the div-block and the form-editing.
Greetings from Germany
Henning
15:46

01/04/2010

Hi again,
so I try a little bit to fix the problems with 2 Editing-Mods. If my Form is created I do the following in afterShowForm to get the right value from the Inline-Form:
$(".edit-cell").html(val);
But I didn't understand if I want the faild Input-Element, if I clicked on Change-Button, and the Inline-Edit-Cell is active to get the right value. In my case it is the Column BV_MENGE:
In this case I saw the Input-Html-Element but not the value that is in the Inline-Edit-Cell that is in the .edit-cell Element.
Greetings from Germany
Henning
22:03

21/03/2013

In my case I needed the value of the cell during a row select event. I was also getting all that HTML mentioned in red but I was able to move move my code BEFORE I moved the row to edit mode. My code to get the cell value is:
grid.jqGrid("getCell", id, 1) //id is the id assigned to the row. 1 is the number of the column where the value is
All code:
Markup: <ClientSideEvents RowSelect = "editRow" />
Script:
var lastSelection;
function editRow(id) {
if (id && id !== lastSelection) {
var grid = jQuery("#myJQGridID");
theCellValue = grid.jqGrid("getCell", id, 1);
//First got the value. Now move to inline edit:
grid.editRow(id, true);
lastSelection = id;
}
}
Fot others, maybe this little hack may work: 1. Temporarily get out of edit mode, 2. Get the cell value, 3. Move back to edit mode.
Most Users Ever Online: 715
Currently Online:
56 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66