jQWidgets Forums

jQuery UI Widgets Forums ASP .NET MVC How to bind button inside column of gird generated by Tag Helper

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Stoev 8 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Admir Hodžić
    Participant

    I am trying to create Grid using MVC Tag helpers.
    One of columns should have type “button” .
    When I create column in Razor I write something like

    <jqx-grid-column column-type="button" datafield-for=@(gridRedDummy.id) cells-renderer="naredajDugme()" ></jqx-grid-column>

    This does render column whit buttons inside column .
    But I do not see way to bind that button to any event.
    There is intellisense autocomplete button-click property for column.
    But it accepts C# object not string.
    What I can pass to button-click so I get js event bind on button click ?
    I did try asp on-click="clickEnvet()" setting for Column but no success.


    Admir Hodžić
    Participant

    I did pass over problem by binding cellclick for entire grid in JS
    My ready function looks like

     $(document).ready(function () {
                $("#grid").bind('cellclick', function (event) {
                    if (event.args.columnindex == 12) {
                        editrow = event.args;
                        console.log(editrow.row.bounddata.id);
                    };
                });
                });

    Sub-question:
    Is there a way to bind cellclick for grid inside razor for column.

    Razor give us

    <li>cell-begin-edit</li>
    <li> cell-end-edit </li>
    <li>cell-value-changing</li>

    events
    Can we get here Click bindig ?


    Peter Stoev
    Keymaster

    Hi adopilot,

    We do not have column events so I suggest you to use the Grid’s events.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.