ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
GRID - Cell property
Title:
B
I
{code}
?
Is it possible to set a single cell property like "id" ? es: <tr class="awe-row"><td id="myprop">1935</td></tr>
Save Changes
Cancel
Meccanica Rossi
asked at 07 Jul 2017
you can set css class of the cell by setting `Column.CssClass`; why do you need to set id for the cell ?
at 07 Jul 2017
Omu
I would like to add a ContextMenu to a cell like this web application http://www.caivola.it/files/grid.png How can you see, on the 2nd column, there is a article SKU, and with right click i can show a contextmenu, where i can do many function to this article (edit,delete,display etc etc) To do this I need a article ID stored somewhere. Now I can do this, adding a column with ClientFormatFunc like this... but i need 2 columns !! function articleMenu(art) { return '<button type="button" id="' + art.Id + '" class="testButton"></button>'; }
at 07 Jul 2017
Meccanica Rossi
you can get the id or any other model property using `row.data('model')` example: `$('#Grid1').find('.awe-row:first').data('model').Id`
at 07 Jul 2017
Omu
Very good .. In your sample get data from first row, but how get row from cell that user do the cell click ? I can do this `new Column { Bind = "SKU", CssClass = "cellwithcontextmenu" },` $('#articlesGrid') .on('aweload', function () { $('.cellwithcontextmenu').on('click', function (e) { console.log('clicked', this); }) });
at 07 Jul 2017
Meccanica Rossi
$('#articlesGrid').on('click','.cellwithcontextmenu', function () { console.log($(this).closest('.awe-row').data('model')); });
at 07 Jul 2017
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK