Is there any event to capture the row double click event? And i need how to read an item in the selected row and pass it as a query string to some other page. I need sample in ASP.NET MVC Razor (cshtml). It will be great if some one can assist me on the same.
Hello Suresh A,
Currently igGrid doesn't support row double click event out of the box. As a workaround you can use jQuery dblclick function and bind to igGrid directly to listen for double click events.
Your code should look like this:
$("#grid1").dblclick(function (event) {
// row html element
var row = $(event.target).closest('tr');
// data key value
var key = row.attr("data-id");
// cell values
var cellZeroValue = row.find('td:eq(0)').text();
var cellOneValue = row.find('td:eq(1)').text();
var cellTwoValue = row.find('td:eq(2)').text();
// get the next cell value by changing eq index argument. For example :eq(3) will return four element
}
);
igGrid MVC wrapper obviously doesn't have row double click event functionality also. You can use it to create the grid, but you have to put JavaScript code as the code above to listen for double click events.
You can find good examples on how to create igGrid in Razor code in our samples site:
https://www.igniteui.com/grid/overview
You can also want to look at this forum post:
https://es.infragistics.com/community/forums/f/ignite-ui-for-javascript/59503/get-value-from-selected-row-on-double-click
Hope this helps,
Martin Pavlov
Infragistics
Hello Martin,
Thanks a lot. I will try it out and will update you.
Regards,
Suresh A
The code below works fine for the first time when we open the popup
<script type = "text/javascript" > $(document).ready(function () { $('#igGrid1').delegate('.ui-iggrid-activerow', 'dblclick', function (e) { var row = $('#igGrid1').igGridSelection('selectedRow'); var dataview = $('#igGrid1').data('igGrid').dataSource.dataView(); var cellValue = dataview[row.index]["UserId"]; var address = "@Url.Action("ModifyUser")" + "?UserId=" + cellValue; window.location = address; var $dialog = $("#modifyUser").load(address).dialog({ autoOpen:false, modal:true, }); $dialog.dialog('open'); }); })</script><div id="modifyUser"></div>Here i am using div tag to show the dialog. It works fine for the first time only. Say for example if i have 100 rows in a grid when i double click 1st row and close it and if i double click on the 2nd row i am getting the error in the below line var row = $('#igGrid1').igGridSelection('selectedRow');and the error message is as belowMicrosoft JScript runtime error: Object doesn't support this property or methodIt will be great if you can let me know how can i fix the issue.Regards,Suresh A
Hello Suresh,
Thank you for your update.
I am not able to
Can you please upload an isolated sample reproducing the issue?
You can do this here or through your support ticket CAS-82287-FDBWKR
Hope hearing from you
Hi Tsvetelina Georgieva
Where can i submit the code? Can you please share me the path to upload the solution so that i can do the same. Because i tried searching for the incident number which you have mentioned i was not able to find any.
Thank you for getting back to me.
I have created a support ticket with case number CAS-82287-FDBWKR,
which you can monitor by going to the “My IG” tab on our website, and selecting "My Support Activity" from the drop-down.
https://es.infragistics.com/Membership/MySupport.aspx
You can attach your code in a zipped format to the case.
Let me know if you need further assistance
I have added the solution file to the support ticket. Kindly check the same and let me know ASAP.
Is there any updates on this?