Re: Spry XML data set and dynamic post variables
Well I had it working when I stripped back everything and just had the dss data
set and a single onclick function, but now that I put it back together it hash
foobared again.
Here are the relevant bits of code that I've changed.
The function to change server id:
//function to run when changing the server id
function changeServer ( sid ) {
//set the url to use the current server id
dss.setURL = ( '../../cgi-bin/server_details.pl' , { method: 'POST' ,
postData: 'sid=7gv1m3vjvagfl7h7qeefb8iodj8evhmb&ip=127.0.0.1 &cid='+sid } );
//force a reload of the server data
dss.loadData();
}
The inital load of the data set
var dss = new Spry.Data.XMLDataSet ( '../../cgi-bin/server_details.pl' ,
'yams' , { method: 'POST' , postData:
'sid=7gv1m3vjvagfl7h7qeefb8iodj8evhmb&ip=127.0.0.1 &cid=0' , subPaths: [ "auth"
, "plugins" , "plugins/plugin" ] , keepSorted: "true", sortOnLoad:
"plugins/plugin/order", sortOrderOnLoad: "descending", useCache: false,
loadInterval: 10000 } );
And the part that changes the server id
<td align="left" style="cursor:default; width:174px;"
onclick="changeServer({dsv::servers/server/@id})"> {dsv::servers/server/name}</td
>
I checked that the function is receiving the correct server id and I even
tried hard coding the cid variable to 2 in the change function but it still
wasn't changing on the server side.
Any ideas?
Thanks
|