Hi all,
I have a igGrid and i want to add a column with one ACTIONLINK or similar.
When i clicked the action link i want to go other view with other action to show row details in other view.
another option would be, on double click on the row, go directly to another view
It's this possible?
a lot of thanks for advance
it's does'nt works i put the code:
Hello Ruben,
What I see is that you pass some invalid arguments to the DataType method like "Guid".
The valid arguments are "number", "string", "bool", "date", "object".
For the ID column you should put "string" or "number".
If this doesn't help, can you inspect the generated JavaScript code for the grid (open the page source and search for "igGrid1". There will be a JavaScript code with te grid configuration) and paste it for me to see.
Hope this helps,
Martin PavlovInfragistics, Inc.
Hi Martin,
it's great, I do this and i capture the double click event, but i don't understand everything,
the rowid part doesn't show anything if i put some alerts messages
I put my code here:
Javascript code
<script type="text/javascript"> $("#igGrid1>tbody>tr").live("dblclick", function (e) { alert("Doble click"); e.preventDefault(); e.stopPropagation(); alert("Antes de row"); var $row = $(e.target).closest("tr"); alert($row); var rowId = $row.attr("data-id"); alert(rowID); window.location.href = "home/details/" + rowId; // or use window.open });</script>
<div style="width:95%;float:left;"> @( Html.Infragistics().Grid<Comics>() .ID("igGrid1") .Columns(column => { column.For(x => x.ID).DataType("Guid").HeaderText("ID"); column.For(x => x.Nombre).DataType("string").HeaderText("Nombre"); column.For(x => x.Numero).DataType("int").HeaderText("Numero"); column.For(x => x.SuperHeroe).DataType("string").HeaderText("Super Heroe"); column.For(x => x.Escritores).DataType("string").HeaderText("Escritores"); column.For(x => x.Dibujantes).DataType("string").HeaderText("Dibujantes"); @*column.Unbound("UnBound").Template("<a href="'/Documento/Details/${ID}'>Details</a>").Width("100px").HeaderText("Detalles");*@ }) .Features(features => { features.Paging().PageSize(20).PrevPageLabelText("Previous").NextPageLabelText("NEXT"); features.Sorting().Mode(SortingMode.Single).ColumnSettings(settings => { settings.ColumnSetting().ColumnKey("Numero").AllowSorting(true);
}); features.Selection().MouseDragSelect(true).MultipleSelection(true).Mode(SelectionMode.Row); features.Filtering().ColumnSettings(settings => { settings.ColumnSetting().ColumnKey("Nombre").AllowFiltering(true).FilterCondition("equals"); }); }) .PrimaryKey("ID") .ClientDataSourceType(ClientDataSourceType.JSON) .DataSourceUrl(Url.Action("GetComicsList")) .Width("100%") .Height("350") .LocalSchemaTransform(true) .DataBind() .Render() ) </div>
I set the property PrimaryKey with my primary key from my dataBase Table
A lot of thanks for your time
Hi Ruben,
You can hook to grid double click event using this code:
$("#grid1>tbody>tr").live("dblclick", function(e) { e.preventDefault(); e.stopPropagation(); var $row = $(e.target).closest("tr"); var rowId = $row.attr("data-id"); window.location.href = "home/details/" + rowId; // or use window.open});
I've initialized rowId variable with the primary key value, note that you have to define "primaryKey" property of the grid in order this variable to be initialized with the correct value.
Hope this helps,Martin PavlovInfragistics, Inc.
Can't I do this differently? with double click event?
for example:
If igGrid have double click event, this event call to a javascript function?
A lot of thanks,