getdata
getdata(url,success,failure,customupdate)
Get a data from server using the given url. You can use this to get one record using /maindata or multiple records using /listdata
Parameters
- url : the url to use to get data
- success : function to call on successful fetch form the server
- failure : function to call on failure to fetch from server
- cutomupdate : if true we no not call the default handling
function(jdata,who,fromurl){ // do your code for success or failure here }
Function definition for success and failure are the same
deconnect.getdata('/listdata/WebServer?Type=Base&includefields=["ID","Name"]',function(jdata,who,fromurl){ if (jdata.result=='ok' && jdata.listdata.length>0) { var newhtml=''; for (var idx=0;idx<jdata.listdata.length;idx++){ var rec=jdata.listdata[idx]; newhtml += '<div class="naviteml2"><a href=\'/editor/templateeditor.html?ID="' + rec.ID + '"\'>' + rec.Name + '</a></div>\n'; } $("#templates").html(newhtml); } },null,true);
Example of getting data from WebServer table and updating a menu without using default handling