Forum


09:26

08/09/2008

Hi.
My colModes is as follows:
colModel :[
{ name: "co_sector", index: "co_sector", width: 20, editable: true, search: false },
{ name: "nb_sector", index: "nb_sector", width: 90, editable: true, editoptions: {size: "60", maxlength: "60"}, editrules:{requerided:true}}
],
And I hides the "co_sector" (that it is my PK)
jQuery("#list").hideCol(["co_sector"]);
When I submit the data in a "edit" action I receive the co_sector as part of the QueryString.
For delete operation I just add the "co_sector" data in the beforeSubmit method of the delete options. My code is:
{ height:90, width:300, reloadAfterSubmit:false,
beforeSubmit: function() {
var sr = jQuery("#list").getGridParam('selrow');
var rowData = jQuery("#list").getRowData(sr);
this.delData = {"co_sector" : rowData['co_sector']};
retarr = {"co_sector" : rowData['co_sector']};
return retarr;
}
}, // del options
HTH
09:44

17/09/2008

I found a bug. In grid.base.js we have
for (var i=0; i<ts.p.colModel.length;i++) {
if (ts.p.colModel[i].key===true) {
ts.p.keyIndex = i;
break;
}
i++;
}
So because of two increments my key column was skipped. I changed it to
if(ts.p.multiselect) n=1;
else n=0;
for(i=0;i<this.p.colNames.length;i++){
if (ts.p.colModel[i+n].key===true) {
ts.p.keyIndex = i;
break;
}
}
Now it works 🙂
10:46

Moderators
30/10/2007

Hello,
Thank you for this, but sorry this is not a bug.
The for statement is called after constructing the multiselect and subgrid
additinal columns, so this must work - check your code again.
Check your server code again and pay attention on what you return from
server - Is the name exactly as those from colModel.
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.
11:19

Moderators
30/10/2007

Did you see the difference ?
<row ID=”3″>
should be
<row id=”3″>
or change the xmlReader to read the ID instead of id
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.
13:26

08/09/2008

I apply those changes to my code but still I received the row num instead the primary key in the id parameter in an "edit" action. I build my json data as :
rows :[
{id: "11",cell:["11","ADMISTRACIÓN LEGAL Y FINANZAS"]}
]}
And, say, this is the row 3 when i show those data in the grid and when I edit i received the "id" parameter as "3" and not as "11"...
why ?
09:21

Moderators
30/10/2007

Hello,
How looks your jsonReader like?
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.
01:00

Moderators
30/10/2007

Hello,
Try with this
jsonReader: {
repeatitems : true,
id: "id"
},
There is a bug when id:"0" (only) since java interpret "0" as false.
I have corrected this.
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.
17:24

Moderators
30/10/2007

Hello,
to be correct you JSON response should look like:
“rows” :[
{"id": "11","cell":["11","ADMISTRACIÓN LEGAL Y FINANZAS"]}
]}
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.
10:53

08/09/2008

I have:
I have:
rows :[
{id: "11",cell:["11","ADMISTRACIÓN LEGAL Y FINANZAS"]},
{id: "4",cell:["4","ASEGURADORA, ARREDADORA FINANCIERA Y OTROS AFINES"]},
{id: "16",cell:["16","CAJA DE AHORRO, COOPERATIVA O AFINES"]},
{id: "10",cell:["10","CENTROS EDUCATIVOS Y AFINES"]},
{id: "2",cell:["2","COMERCIALIZADORA DE PRODUCTOS ELECTRÓDOMESTICOS, COMPUTACIÓN, MAN"]},
{id: "1",cell:["1","EDITORIAL, VENTA DE LIBROS (MAYOR O DETAL) Y AFINES"]},
{id: "14",cell:["14","EMPRESAS DE CONSULTORÍA, DESARROLLO DE SOFTWARE Y AFINES"]},
{id: "17",cell:["17","EMPRESAS DE SERVICIOS EN GENERAL"]},
{id: "15",cell:["15","FUNDACIÓN SIN FINES DE LUCRO"]},
{id: "9",cell:["9","INMOBILIARIAS, ADMINISTRADORAS DE BIENES RAÍCES Y AFINES"]}
]}
And in my grid i have
colNames:['Codigo','Nombre'],
colModel :[
{ name: "co_sector", index: "co_sector", key: true, width: 20, editable: false, search: false, hidden:true },
{ name: "nb_sector", index: "nb_sector", width: 90, editable: true, editoptions: {size: "60", maxlength: "60"}, editrules:{requerided:true}}
],
jsonReader: {
repeatitems : true,
id: "co_sector"
},
But I don't receive "co_sector" when edit or delete a row...
04:05

Moderators
30/10/2007

Hello,
I think you mixed colModel with the real JSON data in the jsonReader.
Try with the default options of jsonReader - i.e. do not set in your grid
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:
74 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