Forum
15:24
26/01/2010
I noticed new function in github repository
var ret;
ret = obj[expr];
if(ret===undefined) {
try {
ret = eval("obj."+expr);
} catch (e) {}
}
return ret;
},
it seems to be a misstype. there is no "obj" in global space to deal with so it might be
And I think this is not very safe operation
may be you should use this plugin
http://benalman.com/projects/j.....ct-plugin/
to get
20:14
Moderators
30/10/2007
Hello,
Thanks.
Did you try the script?
Also I know that using eval is not safe.
I will see if we can done it better. Thank you for the link - it help me to understand another way of doing this and maybe we will change this behaviour.
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.
13:00
26/01/2010
14:42
26/01/2010
16:34
26/01/2010
I have a problem with this new code
Sorry but my inglish is too poor to describe this isue properly
I have a mapping
{name:"login", index:"login", width:100, sorttype:"string", editable: true},
{name:"firstName", index:"firstName", width:100, sorttype:"string", editable:true},
{name:"lastName", index:"lastName", width:100, sorttype:"string", editable:true},
{name:"newPassword", index:"newPassword", hidden:true, editable: true, edittype:"password",editrules:{edithidden:true}},
{name:"confirmPassword",index:"confirmPassword", hidden:true, editable: true, edittype:"password",editrules:{edithidden:true}}
It not really matters what columns I have. Look at last two of them. They are hidden and editable. The front-end dont need real passwords becouse they are encrypted and so on. So I dont send this fields
before this changes (before you create getAccessor) this code works fine. and now it breaks with erroron line
becouse obj[expr] === undefined and prm is an integer and have no length
I dont think this is a bug but note that new code is incompatiable with old one
17:09
Moderators
30/10/2007
Hello,
Thanks. Could you please try with this
getAccessor = function(obj, expr) {
var ret,p,prm;
ret = obj[expr];
if(ret===undefined) {
if ( typeof expr === 'string' ) {
prm = expr.split('.');
}
try {
if(prm.length) {
ret = obj;
while (ret && prm.length) {
p = prm.shift();
ret = ret[p];
}
}
} catch (e) {}
}
return ret;
},
Please let me known if everthing is ok.
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.
17:14
26/01/2010
19:10
12/06/2009
Hello,
I have a problem with getAccessor() in grid.base.js v3.6.5 line 464
getAccessor = function(obj, expr) {
var ret,p,prm, i;
if( typeof expr === 'function') { return expr(obj); }
ret = obj[expr];
if(ret===undefined) {
if ( typeof expr === 'string' ) {
prm = expr.split('.');
}
try {
i = prm.length;
if( i ) {
ret = obj;
while (ret && i--) {
p = prm.shift();
ret = ret[p];
}
}
} catch (e) {}
}
return ret;
}
The line 464 is where variable "i" is affected with the length of variable "prm".
The variable "prm" is undefined when it's not a string.
To avoid this problem I have moved the try-catch bock inside the body of the if ( typeof expr === 'string' ) {
Regards,
20:14
Moderators
30/10/2007
Hello,
Thank you. This have sence. Fixed.
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.
11:43
02/09/2010
Sorry to say, but problems still remain.
I have experienced a web page to work perfectly on Ubuntu/Firefox 3.6.8 while the same page fails on Windows/Firefox 3.6.8.
The problem was that the expr parameter in some cases is an integer (i.e. neither string nor function) (don't ask me why - I haven't been able to figure that out; it only happen in a single grid out of 6 in my application). In that case, the local variable prm becomes undefined and an exception is raised.
I have fixed it by initialising prm to the empty string like this:
...
if (ret === undefined) {
prm = ''
if(typeof expr === 'string') {
...
However, this fix might bee too simplistic - possibly there should be an explicitly coded reaction on typeof expr === 'integer'.
The JSON data file causing the exception is this one, which - to me -seems flawless:
{"rows": [
{"cell": [26, "MS-S-728-0001 ", "Kirsten", "2010-07-08", "TILL", "Finansministeriet", "Finansministeriet", null, "-"], "id": 26},
{"cell": [32, "MS-M-728-0001 ", "PwSkrivDocTransmittal \u2013 edh", "2010-08-30", "S-ANS", "Finansministeriet", "Finansministeriet", 4, "Start"], "id": 32},
{"cell": [33, "MS-M-728-0003 ", "PwSkrivDocTransmittal \u2013 edh", "2010-08-30", "TILL", "Kbh. Kommunes Milj\u00f8kontrol", "Finansministeriet", 4, "...0001"], "id": 33},
{"cell": [34, "MS-M-728-0004 ", "placeholder 1 descr", "2010-08-30", "ANS", "Finansministeriet", "Finansministeriet", 4, "Start"], "id": 34},
{"cell": [35, "MS-M-728-0005 ", "Placeholder 2", "2010-08-30", "-", "-", "-", 4, "-"], "id": 35}
], "total": 22, "page": 1, "pages": 3}
BTW, thanks for a brilliant plug-in!
Theodor
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