Forum


11:46

26/02/2009

Hallo there,
I want to have a server side message an do it like this:
in the grid:
loadComplete:function(){var meldung = jQuery('#kundenstamm_ed').getGridParam('userdata');
alert(meldung); }
in php/xml:
if ( stristr($_SERVER["HTTP_ACCEPT"],”application/xhtml+xml”) ) {
header(”Content-type: application/xhtml+xml;charset=utf-8″);
} else {
header(”Content-type: text/xml;charset=utf-8″);
}
echo “<?xml version='1.0' encoding='utf-8'?>”;
echo “<userdata>Hello</userdata>”;
but it doesn't work. Can somebody help?
Charlotte
05:22

Moderators
30/10/2007

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.
16:44

22/05/2009

okay, i have no idea what happen to my post, but i can't fix it.
Hi Tony and anyone that can help,
I am using 3.5 beta, JSON as my datatype, and using the userData to return Error messages. According to FireBug, I am getting a response of:
{"USERDATA":{"MSG":"Duplicate Account, Please try a different Account Name.",
"TYPE":"Error"}}
I am trying to create an alert using javascript to display these messages and have added:
afterSubmit:testThis
to nav.
I have built the function around the method getGridParam('userData')
According to the documentation is should return something like:
userData =
{"MSG":"Duplicate Account, Please try a different Account Name.",
"TYPE":"Error"} correct?
now when I create this function:
function testThis()
{
var recorddata = $('#AccountList').getGridParam('userData');
alert(recorddata);
}
it returns an alert telling me there is an object there, but when i try this:
function testThis()
{
var recorddata = $('#AccountList').getGridParam('userData');
alert(recorddata.length);
alert(recorddata.MSG);
alert(recorddata.USERDATA);
alert(recorddata.TYPE);
}
It returns nothing but undefined across the board.
I have also tried running the variable recorddata through a print_r setup for javascript that takes objects and arrays and
represents them textually and it is showing up with nothing, it is just blank.
Somehow, i am loosing the object or it isn't being passed right. Could there be a problem with getGridParam('userData')?
Any and all help would be very much appriecated and if you need to see more of my code let me know.
Thanks again.
17:39

22/05/2009

since I couldn't make it not quote, I rewrote it
Hi Tony and anyone that can help,
I am using 3.5 beta, JSON as my datatype, and using the userData to
return Error messages. According to FireBug, I am getting a response of:
{”USERDATA”:{”MSG”:”Duplicate Account, Please try a different
Account Name.”,”TYPE”:”Error”}}
I am trying to create an alert using javascript to display these messages
and have added:
afterSubmit:testThis
to nav.
I have built the function around the method getGridParam('userData')
According to the documentation is should return something like:
userData = {”MSG”:”Duplicate Account, Please try a different Account
Name.”,”TYPE”:”Error”} correct?
now when I create this function:
function testThis(){
var recorddata = $('#AccountList').getGridParam('userData');
alert(recorddata);
}
it returns an alert telling me there is an object there, but when i try this:
function testThis(){
var recorddata = $('#AccountList').getGridParam('userData');
alert(recorddata.length);
alert(recorddata.MSG);
alert(recorddata.USERDATA);
alert(recorddata.TYPE);
}
It returns nothing but undefined across the board.
I have also tried running the variable recorddata through a print_r setup
for javascript that takes objects and arrays and represents them textually
and it is showing up with nothing, it is just blank.
Somehow, i am loosing the object or it isn't being passed right.
Could there be a problem with getGridParam('userData')?
Any and all help would be very much appriecated and if you need to see
more of my code let me know.
Thanks again.
11:37

Moderators
30/10/2007

Hello,
If you use php maybe you should check how you obtain values - when using GET a $_GET array is used, when used POST a $_POST array is used - if you do not want to have problems you maybe need to use $_REQUEST.
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:
194 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