smartrendering and GET

Hello, we’ve been prototyping with dhtmlxgrid and we’ve been very impressed with your work so far.

I do have a question about enableSmartRendering. It seems to ONLY let me do “GET” as opposed to “POST”, and it seems to ignore any parameters I give it.

Is this an intended behavior or is there a way for me to perform smart rendering via POST? The same question goes for the loadXML() method.


By default all load operations uses GET, while there is no way to control such behavior through API, underlaying layer supports POST as well, and it can be switched to POST by small modification

To switch ALL operation to POST , just update dhtmlxcommon.js

       postMode=true; // this line need to be added

If you need switch some individual operation to POST , you can locate next command


by default command this commands take single parameter - called url, to switch it to post mode it can be updated as<br>
    this.xmlLoader.loadXML(old_url, true, post_vars);

I found that this did not help in the case of smart rendering because smart rendering does not use the function dtmlXMLLoaderObject.prototype.loadXML

Smart rendering actually uses the function “load” which is defined inside of dhtmlxgrid.js

To get smart rendering working using POST, I have done 2 things:

  1. I have switched to using Grid.Post,PostArguments);
  1. I have overridden the dhtmlxgrid load function:
this.Grid = dhxLayout.cells("c").attachGrid();
this.GridPostArguments = 'Argument1=BlahBlahBlah&Argument2=YattaYattaYatta';
this.Grid.ParentSuperGridAndFilter = this;
this.Grid.load = function(url, call, type){
   this.callEvent("onXLS", [this]);
   if (arguments.length == 2 && typeof call != "function"){

   if (!this.xmlFileUrl)
   this.xmlLoader.onloadAction=function(that, b, c, d, xml){
      if (!that.callEvent) return;
      if (!that._contextCallTimer)
         that.callEvent("onXLE", [that,0,0,xml]);

      if (call){

   //******** STANDARD CODE (GET)

  //******** MODIFIED CODE (PUT)
   var QuestionMarkLocation = url.indexOf('?');
   this.xmlLoader.loadXML(url.substring(0,QuestionMarkLocation), true, this.ParentSuperGridAndFilter.GridPostArguments + '&' + url.substr(QuestionMarkLocation+1)); //POST