Links from a SQL table

I’m trying to make my grid have hyperlinks, where each link is specified in a SQL table.

For instance the table could be like:

NAMES LINKS
name1 link1
name2 link2
name3 link3

I’m not sure how to do this though. I have tried formatting the links how the XML link tutorial says, but its not working.

Basically, I want it to be like the table on the main Grid page, where when you click on Rainman, it pulls up wikipedia.

in DHTMLX grid you may set the type of cell to “link”.
The corresponding cell value in XML should be a “^” delimited list of the following values:
1st - Link Text;
2nd - URL (optional), must not contain single quotes;
3rd - target (optional, default is blank).

Dummy link Real link^http://dhtmlx.com Real link^http://dhtmlx.com^_blank Real link^javascript:doSomething("param1","param2","param3")^_self

Yes I got that part, but how do you store that value in a SQL cell? Is it the same format?

You can store that value as you with.
If you are using dhtmlxConnector on the server side you can use “beforeRender” event to formant necessary cell before render it. Please find more information here docs.dhtmlx.com/doku.php?id=dhtm … re_loading

Awesome! Thanks Olga!

I’m confused a little bit.

If I want to place a link in a cell into each row of a grid pointing to another page (for example to a page with a form) and pass the ID of the database record with it (like update.php?MEMBERID=2) how do I achieve this?

Passing the ID with the link configuration to the XML file or use the mygrid.attachEvent like:

mygrid.attachEvent(“onRowSelect”, function(rID,cInd){
alert("#?id="+rID);
})

Or is this another id? Where is the difference?

It would be nice to have such basic problems posted in the documentation with examples. A kind of “how-to” section for common problems. Many of the examples are too special and never needed, but basic stuff is missing. An image example with edit/delete buttons would be nice too. Or will this be implemented in the 3.0 version? I hope so …

Thanks in advance for any help.

you can use “link” eXcell type. Please find more information here docs.dhtmlx.com/doku.php?id=dhtm … cells#link

Thx Olga. And what is the “main use” of

mygrid.attachEvent(“onRowSelect”, function(rID,cInd){
alert("#?id="+rID);
})

? The difference is not so clear for me :wink:

This code shows alert with some information when you select the row