Json attributes with DhtmlxSuite_pro_2008Rel2_80512

Dear DHTMLX,



Are the json attributes also supported with the DhtmlxSuite_pro_2008Rel2_80512 as shown in dhtmlx.com/docs/products/kb/inde … 0attribute . At the moment my titles are empty and I was wondering if this is expected behaviour.



Kind regards.



The build 80512 has not such functionality by default, you can use attached extension in addition to existing js files, to enable support of json attributes.
dhtmlxgrid_json.zip (2.52 KB)

Thanks for the quick response. I was already using the above supplied document, I think it is the same as supplied in the above mentioned post.

However I don`t see the title attribute in any of the fields when using a json value as {:value:‘a’,:title:‘b’} , the value attribute works fine.

I instantiate the grid as follows:

mygrid = new dhtmlXGridObject(‘gridbox’); 
mygrid.setImagePath("/codebase/imgs/")
mygrid.setHeader(“some columns”);
mygrid.setInitWidths(“some widths”)
mygrid.setColAlign(“etc”)
mygrid.setColTypes(“etc”);
mygrid.setColSorting(“etc”)
mygrid.init();
mygrid.enableHeaderMenu();
changeView();
mygrid.setSkin(“clear”);
mygrid.attachEvent(“onXLS”,function(){
var span=document.getElementById(“recfound”);
span.style.color=“red”;
span.innerHTML= ‘loading …’;
})
mygrid.attachEvent(“onXLE”,function(){
var span=document.getElementById(“recfound”);
span.style.color="";
span.innerHTML= mygrid.getRowsNum();
})
mygrid.enableSmartRendering(true,50);
mygrid.load("/overviews.js",“json”);
Am i missing something in order for the tooltips to work ? At the moment I only see the value as the value of the tooltip.

The problem seems to be in the statement eval(“data=”+data.xmlDoc.responseText +";"); for some reason when evaluated the object data:[“cheese”,{:title:“something”, :value:“cheese”}] is evaluated to [“cheese”,“cheese”] . No idea why :frowning: Do you have a suggestion ?

After finding out that my debugger is not reliable, I used firebugs console.info, I found out that the problem was that the title attribute was not used for an img column.
Don`t know if it is fixed in a newer release but the following modification seems to work:

eXcell_img.prototype.setValue=function(val){var title = val; …

to

eXcell_img.prototype.setValue=function(val){var title = val;if(this.cell._attrs.title)var title = this.cell._attrs.title; …


Yes, the img column uses value of cell column, which can be specified as
image^title
In case of dhtmlxgrid 2.0 the title attribute works for all column types including img, the modification which you made resolves problem for grid 1.6 and will not have any drawbacks

Great ! Do you know the place where I can do the same trick for the ro cell type ?

It must work for “ro” column without any additional steps. ( if it somehow still not work - please contact us directly at support@dhtmlx.com - we will provide latest version of dhtmlxgrid.js for your version, which contain some fixes )

In common case , you can modify code of “ro” excell to have its own logic by defining
eXcell_img.prototype.getTitle=function(){
return “anything”;
};