Forum


16:13

19/05/2010

Hello. First off let me state that I'm really like jqGrid. Very nice features and reasonably good docs on the Wiki.
I'm building an application that uses jqGrid and I've written my own custom form for editing data. Everything is working fine but now I'm to the point where I need to update the grid once the data has been saved.
I'd like to only update the SINGLE row that gets added, or edited, but as I've done my own custom dialog (it is a jQuery Dialog, btw), I am not sure what functions I need to call to update the grid with the modified data. Is there any way to achieve this or do I have to just trigger the entire grid to reload?
Thanks in advance.
19:58

19/05/2010

So I made a few changes to my code and started using 'FormToGrid.' It seemed to work well, with one oddity. When I edit an item, and then call 'FormToGrid' everything works properly. However, when I edit an item the 2nd time, one of the columns gets cleared completely before I even save the data (i.e. the form comes up but the element in the grid gets cleared as soon as the form is displayed). I'm wondering if this is a bug in the code related to TreeGrid style grids because the column that gets cleared is the column where the tree icon is displayed (the little arrow/circle). I was going through setRowData and saw this piece of code:
vl = t.formatter( rowid, data[nm], i, data, 'edit');
title = this.title ? {"title":$.jgrid.stripHtml(vl)} : {};
if(t.p.treeGrid===true && nm == t.p.ExpandColumn) {
$("td:eq("+i+") > span:first",ind).html(vl).attr(title);
} else {
$("td:eq("+i+")",ind).html(vl).attr(title);
}
and I am wondering if this might have something to do with it. Seeing as I've only been using jqGrid for one day, I'm a noob here so this may just be grasping at straws.
20:29

19/05/2010

Ok, one last post... maybe :).
This is what the item in the tree looks like before I edit it:
I edit it and change the words "Another Title" to "Changed Title" and now the same element looks like:
When I edit it again, even BEFORE I actually perform the edit, it gets changed to:
Am I missing something here?
20:34

19/05/2010

Found it . Was my fault. I use the ClueTip jquery Add on and was hiding all spans with a title prior to editing the form. This was causing the span that has the title in the jqGrid to be hidden (but only the 2nd time because there's no title when it's first set). Anyhow, problem soved
.
I guess sometimes it just helps to talk through a problem by yourself to diagnose the issues!
Back to the grindstone!
I guess my only other question was related to why the Title of the span is changed to the new value, but the contents of the span retain its original value (or so this is how it seems to react). After I change the value of the cell, the displayed value is always correct. However, when I hover OVER the cell, I see its original value in the hover tip. I'll continue looking at my code to see if this is, once again, a bug in my code. I verified that the non-tree demo works as expected, so I'm guessing it's my code.
20:39

13/05/2010

Yes i realize the complete validation.
Friend, i found the example, that solve my needed, Thank you for his help:
My really needed was call a form with jquery dialog, in this way, the code below soved my problem!
Javascricpt:
function formOpen() {
$("#dialog").dialog();
}
HTML
No HTML, basta colocar uma div e o q estiver dentro dela vai para a dialog:
<div id="dialog" title="Basic dialog">
<div>
<b>Dados do Cliente:</b>
</div>
<br>
<s:div>
<table width="960" border="1" bordercolor="white" >
<tr>
<td width="84"> Nome</td>
<td width="347"><input name="nome" type="text" id="nome" style="width:100%" /></td>
<td width="74"> Sobrenome </td>
<td width="360"> <input name="sobrenome" type="text" id="sobrenome" style="width:60%" /> Apelido <input name="apelido" type="text" id="apelido" style="width:23%" /> </td>
</tr>
<tr>
<td> Personalizado</td>
<td><input name="nomeabreviado" type="text" id="nomeabreviado" style="width:100%" /></td>
<td> Email</td>
<td><input name="email" type="text" id="email" style="width:100%" /></td>
</tr>
<tr>
<td> CPF</td>
<td><input name="cpf" type="text" id="scpf" style="width:42%" /> CNPJ <input name="cnpj" type="text" id="scnpj" style="width:44%" /> </td>
<td> Email Alt.</td>
<td><input name="emailaleternativo" type="text" id="emailaleternativo" style="width:100%" /></td>
</tr>
</table>
</s:div>
<br>
</div>
<!—Chamada-->
<button id="add" onclick="formOpen()" >show</button>
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