Forum
I have a row in edit mode (editGridRow), then i do something like:
saveRowData(rowid,{
"col1":"hisval","col2",""
})
current row hav these two 2columns, and with this method i want to fill
only the first column, the second col must be filled by the user. But after i call the saveRowData this way the row is "closed" for editing after that
if i dont set secund col "col2" as "" (set only col1 value with saveRowData)
method there is no problem.
Greetings!
02:45
Moderators
30/10/2007
Should I mean that you want to set extraparams?
I suppose you have make typo here since the right syntax for saveRow
is
saveRow(rowid, succesfunc, url, extraparam, aftersavefunc,errorfunc)
Is the syntax for extraparams like this {col1:"hisval",col2:""} ?
or this {col1:"hisval",col2} which is wrong IMHO
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.
03:50
Moderators
30/10/2007
Could you please post your code here or send me to: tony at trirand.com?
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.
I have jqGrid with 3 columns,
1. id column,hidden
2. Name column text, not editable by user
3. Kind type combobox editable
on dbclick i set editRow for dbclicked row
i`m using setRowData as callback from other action to change the
name Name and id column:
$("#gridid").setRowData($("#grid").getGridParam("selrow"),
{"id":"newid",
"Name":"NewName",
"Kind":"0"}
)
after this action current row is closed for editing by the setRowData.
if i do:
$("#gridid").setRowData($("#grid").getGridParam("selrow"),
{"id":"newid",
"Name":"NewName",}
)
without set Kind column value
current row is not closed for edit wich is fine for me.
After playing a while with this behavior I noticed that if i set with
setRowData only the editable column (in my case Kind column wich is type"select") the row is closed for edit from himself again.
05:23
Moderators
30/10/2007
When you call setRow - before or after editRow?
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.
06:01
Moderators
30/10/2007
Could you please publish the full code in ondblClickRow event?
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.
I did not understand why but ...
$("#healthExpertGrid").editRow(rowid,false);
$("#healthExpertGrid #"+rowid +" input,select").each(function(){
$(this).attr("size","");
$(this).css("width","96%");
$(this).css("font-size","13px");
})
if($("#healthExpertGrid #"+rowid).attr("status")!=recInsert)
$("#healthExpertGrid #"+rowid).attr("status",recEdit);
EditPerson();
$("#container input,select,textarea").focus(function(){
lastSelection = $(this).attr("id");
})
$("#healthExpertGrid #"+rowid).keyup(function(e){
var keyCode = e.keyCode || window.event.keyCode;
if(keyCode == 27){
$("#healthExpertGrid").restoreRow(rowid);
$("#healthExpertGrid #"+rowid).attr("status",recBrowse);
}
});
}
06:57
Moderators
30/10/2007
Do not see setRow instead. (Mybe you call it in EditPerson() function)
What I try to explain is:
If you call editRow on grid and after editRow you call setRow on same grid your data is overwritten by setRow the field has a flag editable,but with data that is overwritten - so you can anymore do edit an this until you not call
restoreRow.
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.
The thing that i want to explain is:
when i set new values of columns
with setRowData method and describe in this method all the columns
and theri values the row after that the row colsed himself(all inputs
and select are text which user can`t edit) if it was in
edit mode(editRow) and I did not call SaveRow to do that.
Describes in my third post.
07:47
Moderators
30/10/2007
Sorry maybe I do not understand.
So:
1. you call editRow;
(some fields are not editable and only Kind is editable)
2. you call setRowData(rowid,{”id”:”newid”,“Name”:”NewName”,
“Kind”:”0"}) right?
In this case the editable column Kind is overwritten with the value and it
is no more editable - right?
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.
08:05
Moderators
30/10/2007
This is expected behavior and not a bug. Let me try to explain:
The reason when you call this way
setRowData(rowid,{”id”:”newid”,“Name”:”NewName”)}
and all is ok is that these fields are not editable. As of the names of the
methods they operate per row and not per cell.
To work this you should set the row to be not editable after
setRowData something like
$("#rowid","#mygrid").attr("editable","0");
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.
08:07
Moderators
30/10/2007
But I 'm not sure if after this you will have the expected behavior.
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.
I think I might have a similar situation. I have two columns — account and amount — in a grid where the rows represent the parts of an accounting transaction. When I add a row, the user selects an account and my javascript code then calculates what the amount would have to be based on all the other rows (it tries to force a balance across all rows in this transaction). It then sets the amount cell to this calculated amount.
But it is possible that the user does not want all of the outstanding amount to go to this account, so he (or she) has to be able to edit the amount before saving the row.
What happens is, the javascript calculates the balance, then uses
$('#tblwriteoff').setRowData(id,{ 'amount':num } );
to set the amount column on this row to the balance and the cell, which previously was editable (before I selected the account), no longer is.
So I tried
$('#' + id + '_amount').val(num);
and this is even worse; now the amount does not hold its value.
After that I tried
$('#tblwriteoff').setCell(id,'amount',num);
and still no joy. The amount is there but the cell is not editable. WHen I save the row (I am using keys:true so I press enter when the cursor is in the account cell) the amount data disappears.
Am I doing something wrong and one of these should work, or is the cell going to be not editable whatever I do?
And if so, what do you suggest for pre-populating a cell and still leaving it editable?
Thanks,
Reg
04:37
Moderators
30/10/2007
Maybe I will explain this in detail.
1. When the grid is constructed we have something like:
...
<tr id='123'><td>myval</td>..</tr>
...
After editRow we have
<tr id='123'>
<td><input id='123_myname' ..val='myval' /></td>...
</tr>
So when we call after this setRowData the entry input tag is replaced with the value from setRowData.
Now - one possible solution is those from Reg
$("#"+id+"_myname","#mygrid").val("newvaluehere")
Another solution is to write additional method which will act to this case
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.
Most Users Ever Online: 715
Currently Online:
33 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