Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by fathul wahhab on Mar 23, 2009 02:35
open dhtmlx forum
dhtmlx connector $action->invalid();

how to show the error message on the client side if the server-side = " $action->invalid();"

thx
Answer posted by Support on Mar 23, 2009 05:38
You can use 

on server side
      $action->set_response_text(" error message text here ");
      $action->invalid();


on client side, add next line to dataprocessor init

     dp.defineAction("invalid",function(tag){  //tag - XML tag which contains error details
          var text = tag.firstChild?tag.firstChild.data:"";
          if (text) alert(text);
          return true;
     })


Instead of text, in above scenario, set_response_attribute can be used, it will made access data on client side is less cryptic, but it has limitation on content.
Answer posted by Support on Mar 23, 2009 05:52
Some more info can be obtained from
http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Dataprocesor_usage.html#grid_art_dataprocessor
"Custom server side responses" section