Set value in a grid connector

I set a grid connector and can load the data to a grid from database.

Normal, the grid data is same as connector database.

Now, a column in connector database is only set to < 0 > or < 1 >.

I want to ask this column < 0 > display as < TRUE > and < 1 > display as < False > when load data from connector to a grid.

It is work ? And How about the method ?


  var grdResult = lyoMain.cells("b").attachGrid();

    //Define Grid dataloader and data processor

 grdResult.setHeader("Table Type,Field Name,Display Name,Reserved Field,Display Index,Input Type,Allow Null,Content Type,Input Length,Fill The Rest,Justify,Note");

 grdResult.setColumnIds ("TABLE_TYPE,FIELD_NAME,FIELD_DISPLAY_NAME,IS_RESERVED,DISPLAY_ON_TOP,INPUT_TYPE,ALLOW_EMPTY,CONTENT_TYPE,MAX_LENGTH,FILL_REST,VALUE_JUSTIFY,NOTE");
   
    grdResult.init();


dpGrid = new dataProcessor("GridConnector.ashx?strSQL=SELECT TABLE_TYPE,FIELD_NAME,FIELD_DISPLAY_NAME,IS_RESERVED,DISPLAY_ON_TOP,INPUT_TYPE,ALLOW_EMPTY,CONTENT_TYPE,MAX_LENGTH,FILL_REST,VALUE_JUSTIFY,NOTE FROM MASTER_PARAMETER_DEF&strUser='SYSTEM'");

  dpGrid.setDataColumns([true, true, true,true]);
  dpGrid.init(grdResult);

Normally, I load data from connector database to a grid. But I only want to change field content according to original field.

You can use beforeRender server side event to format data before sending it to the client side.

docs.dhtmlx.com/doku.php?id=dhtm … formatting

Stanislav,

Can you provide the normal script coding which is same as my given example.

Because I do not use the coding type < beforeRender server side event >.

Sorry, but I’m not sure what do you mean by normal script

If you are using connector on server side it has beforeRender ( ItemPrerender in case on .Net docs.dhtmlx.com/doku.php?id=dhtm … re_loading ) and will work for any kind of data configuration.

Stanislav,

OK !

I do not use PHP database.

I mean I use < SQL statement > in <MSSQL 2008 R2> database.

Can the code provide for my usage in database ?

If you are using connector ( doesn’t matter which database ), check next link
docs.dhtmlx.com/doku.php?id=dhtm … re_loading

It will work for any DB type