This is a migrated thread and some comments may be shown as answers.

add command columns to a grid defined from an HTML table?

2 Answers 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
TK
Top achievements
Rank 1
TK asked on 14 May 2012, 12:28 AM
Hi,

How can I add command columns to a grid that I defined from an HTML table?

The only way I have seen to add a command column is through the example code, where the command columns are included in the column definition.

Since I am defining from an HTML table, I have not needed to define the column set in Javascript, so I am unclear how to add a command column (edit / delete) in this case.

Thanks

2 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 23 May 2012, 02:40 PM
I have a similar situaton.  Did you ever figure this out TK ?
0
TK
Top achievements
Rank 1
answered on 23 May 2012, 03:15 PM
Yes, I found a solution elsewhere since the forum was a dead end.

You add a column, and you put your own <a /> tag, and add the classes to format it as a grid button.

You are responsible for wiring up the button to whatever event or handler or javascript you want, but visually it keeps the consistency of the built in command buttons.

<a class="k-button k-button-icontext k-grid-add" id='whateveryouwant'><span class="k-icon k-add"></span>Add New User</a>

With the span you also get their icons too if you want them.

I am not sure what other classes are there to provide formatting - haven't gone into it yet.  I just relied on intellisense to show me what was available at the time for the button I needed.

Tags
Grid
Asked by
TK
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
TK
Top achievements
Rank 1
Share this question
or