Links in dhtmlx Grid Tables

Hello,



I want to be able to add a link to a dhtmlxGrid page so that when the user clicks on the link it executes a javascript function I’ve defined in the Grid.jsp document.



I’ve set the mygrid.setColTypes = link for the column in question.



mygrid.setColTypes(‘link,ro,ro,ro,ro,ro,ro,ro,ro,ro’);



I’ve defined the function within the grid.jsp file.



function editCell(table, id, ro) {

dhxWins = new dhtmlXWindows();

tbWindow = dhxWins.createWindow(“tbWindow”, 100, 100, 800, 600);

tbWindow.center();

tbWindow.show();

}



Here is an example of the cell data defined in the getGrid.xml document used for the mygrid.loadXML function













Could anyone help with this? I suspect it is an issue with the format of the xml file. Any help would be appreciated.



Regards,



Sam

Please make sure if you have attached dhtmlxgrid_excell_link.js to your page. If issue still occurs please provide us more detailed information.


Hello,



Yes, the dhtmlxgrid_excell_link.js file is included in the grid.jsp file I am using.  I have also included a list of the other dhtmlx files included.



Could this be an issue with the format of the xml file?



Any help would be appreciated.



Kind regards,



Sam



 



dhtmlx/dhtmlxgrid.css
dhtmlx/dhtmlxgrid_skins.css
dhtmlx/dhtmlxwindows.css
dhtmlx/skins/dhtmlxwindows_dhx_blue.css
dhtmlx/dhtmlxcommon.js
dhtmlx/dhtmlxgrid.js
dhtmlx/dhtmlxgridcell.js
dhtmlx/ext/dhtmlxgrid_srnd.js
dhtmlx/ext/dhtmlxgrid_filter.js
dhtmlx/excells/dhtmlxgrid_excell_link.js
dhtmlx/dhtmlxwindows.js


Hello,


please, use _self instead of _blank


Link^javascript:editCell(“table”,“1”,0);^_self





Hello,



Thanks for getting back to me.  I’ve tried to use _self instead of _blank but I still get the same results i.e. a blank window opens with javascript:editCell(“table”,“2”,0); in the address bar.



Aha, success!!!



The url and target fields are non mandatory so I’ve added the javascript call as a html link in the name parameter of the .xml file



<![CDATA[ Link^^_self   ]]>





This includes the text Link as a hyperlink in the column, once clicked on it executes the js function.



Many thanks for your support with this.



Kind regards,



Sam