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://ko.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
Hi Martin,
Kindly find below the answers for your question
1. What features do you use in igGrid?
features.Selection().MouseDragSelect(true).MultipleSelection(false).Mode(SelectionMode.Row);
2. Which browser are you using in your tests? What version?
IE 8
3. Can you confirm that the bottleneck is in getting the row or cell values from the grid in the double click function?
Row value. I have followed your code.
4. Can you confirm that the bottleneck in not in opening the popup window?
When i give window.location = address it is opening fine but when i give window.open(address) then it is taking a lot of time. Let me know is there any other way to open the popup window.
My requirement is as below
I have a grid when i double click a row it has to open a popup window which wll have options to modify certain details. After the modification the popup needs to be closed and the grid needs to be refreshed with the modify values.
Let me know how can i acheive the same.
Any update on this???
Hello Suresh,
Thank you for posting in our forums.
I created a support ticket on your behalf
CAS-82287-FDBWKR
You can upload your sample code to the case
as we are not able to reproduce the issue in our environment
using the appoach which Martin provided you.
Please zip all the files before attaching them to the case.
Hope hearing from you.
Hi Tsvetelina Georgieva,
Thanks for your response. As mentioned earlier when i use window.open its getting some time to load the page where as if i give window.address its opening fine.
My issue is
<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; }); }) </script>
The above script works perfectly fine when i double click on the grid which is in the users.cshtml page.
I have 2 pages
1. Users.cshtml - Displays the user details int he grid. When i double click i need to
open a modal popup window where i will pass user id as a query string to modifyusers.cshtml page
2. ModifyUsers.cshtml - User is allowed to modify certain details on the page. On click of save button
it is updating the details to the DB. After it gets updated the popup needs to be closed and
the grid in users.cshtml must be refreshed.
How to acheive the same?
Any updates on this?
Is there any updates on this?
I have added the solution file to the support ticket. Kindly check the same and let me know ASAP.
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://ko.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
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 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