Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
userdata and alert
02/07/2009
11:46
Avatar
Lotte
Member
Members
Forum Posts: 10
Member Since:
26/02/2009
sp_UserOfflineSmall Offline

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

08/07/2009
05:22
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Maybe this will help.

http://www.secondpersonplural......16ksnu.htm

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/07/2009
16:44
Avatar
scavanger
Member
Members
Forum Posts: 13
Member Since:
22/05/2009
sp_UserOfflineSmall Offline

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.
16/07/2009
17:39
Avatar
scavanger
Member
Members
Forum Posts: 13
Member Since:
22/05/2009
sp_UserOfflineSmall Offline

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.

20/07/2009
08:56
Avatar
scavanger
Member
Members
Forum Posts: 13
Member Since:
22/05/2009
sp_UserOfflineSmall Offline

Hello again,

I managed to get the userdata to show up in the alert, however it looks like

only the userdata response from the "GET" is being displayed in the alert.

The Reponse for the "POST" is failing to show up.

Please does anyone have any suggestions?

Thank you

20/07/2009
11:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information