This project is read-only.

CANNOT make grids onRowSelect work at all

Sep 4, 2015 at 1:15 PM
in mvc there is a grid, i used .Named("ast") to hopefully assign some name/id, and even put this within a div called astr, I am just trying to make this grid work as the Sample grid does on your main page. When a row is clicked? it shows extra information.

Please help with setting this up to work. the grid was easy to make, but having any click event or RowSelect? i cannot find documentation nor figure it out
<div id="astr">

    @Html.Grid(Model).Named("ast").Columns(columns =>
{

    columns.Add(model => model.Asteroid).Titled("Asteroid Number").SetWidth(10);
}).WithPaging(10)
</div>
And the function? am i missing something? is there another declaration needed? is there something needed in the controller? its only return View(db.name...) and nothing is marked up in the Model, it was a default bootstrap/Entity Framework scaffolded view with edit/delete and the goal was to convert to this Grid.Mvc. but the main functionality with the row select to be able to implement edit/details/delete, doesnt work; thanks for any help
script>
    $(function () {
         
        astr.addFilterWidget(new CustomersFilterWidget());
        astr.onclick(alert("clicked"));

        astr.columns.onRowSelect(function (e) {
           alert("clicked! ");
            $.post("/Home/GetOrder?id=" + e.row.OrderID, function (data) {
                if (data.Status <= 0) {
                    alert(data.Message);
                    return;
                }
                $("#order-content").html(data.Content);
            });
        });
    });
</script>