After spending a lot of time on research, I finally found a suiting grid for my ASP.NET MVC application, it is the mvc-grid. Now, after implementing it everthing is looking fine, but I noticed that one essential function was missing, I cannot click on the items (columns). As far as I can see there is not such property to tell to one of the columns that it is clickable (or even the whole row could be clickable and change color when clicked). But I need it to be clickable in order to display the details to the selected item.
Has anybody implemented this kind of Grid and has any information on how to make the columns actual links (buttons ...) and e.g. call a javascript function
Here is the code of the grid:
@(Html
.Grid(Model)
.Build(columns =>
{
columns.Add(model => model.Name).Titled("Name");
columns.Add(model => model.Surname).Titled("Surname");
columns.Add(model => model.Age).Titled("Age");
})
.Pageable(pager =>
{
pager.PagesToDisplay = 2;
pager.RowsPerPage = 4;
})
.Filterable()
.Sortable()
)
Thank you
I have found a solution for this Grid component.I just have to add the column like this:
columns.Add().Encoded(false).Sanitized(false).RenderValueAs(o => @<a href="/INV_Locations/Edit/@o.Id" class="btn btn-success btn-sm noDecoration"><span class="glyphicon glyphicon-pencil"></span> Edit</a>).SetWidth(15);Actually that was the first component I was using but since it does not provide Ajax Paging I had to switch (although those 2 components are pretty similar)
I tried using this method with the component I am using, but there is no such method as
RenderValueAs, there is a methodRenderedAsbut it does not take the same arguments and when I use it like theRenderValueAsmethod I get the error:I guess there must be a way implementing a column as a link (otherwise the grid would be useless), but there is no documentation where I could look at so I hope that somebody did that already and can give me some tips
Thank you