Skip to content

Replies

0
Alexander Todorov
Alexander Todorov answered on Jan 15, 2013 12:25 PM

Hi Gowtham,

You can enable the selection feature, and handle selectionChanging / selectionChanged events, but in that case if a row is already selected, and you double click again on it, no events will fire, so i am not sure if this suits your needs. My suggestion would be to bind a double click event to the rows, and use it for this kind of logic:

$("#gridId tr").dblclick(function (evt) {

var row = $(this); // this gives you the row TR element

var rowId = row.attr("data-id"); // this gives you the row primary key (ID)

var rowData = $("#grid1").data("igGrid").dataSource.recordByKey(rowId); // this returns the object holding the data for the row, in the data source

});

Let me know if this helps. Thanks,

Angel

0
Alexander Todorov
Alexander Todorov answered on Sep 4, 2012 8:54 AM

Hey,

as i have pointed out in a previous post, the primary key is encoded in every TR, in a data-id attribute. it doesn't matter how the property holding the primary key is named, it is not used as an attribute. all HTML attributes are prefixed with data-* in order to be W3C compliant.

$("#grid1_scroll").scrollTop($("#grid1").find("tr[data-id='<primary key value>']").first().position().top);

instead of:

$("#grid1_scroll").scrollTop($("#grid1").find("tr[timestamp='<primary key value>']").first().position().top);

Hope it helps. Thanks,

Angel

0
Alexander Todorov
Alexander Todorov answered on Aug 31, 2012 7:42 AM

Hi,

1. No, I mean $("#grid1_scroll"). That's the ID of the scroll container. The grid has it so that it can show scrollbars and render complex layouts

2. This isn't part of the igGrid API, it's part of jQuery:

http://api.jquery.com/find/

3. yes

Hope it helps. Thanks

Angel

0
Alexander Todorov
Alexander Todorov answered on Aug 28, 2012 12:29 PM

Hi,

yes it is possible. I hope this snippet works for you:

$("#grid1_scroll").scrollTop($("#grid1").find("tr > td:contains('323')").first().position().top);

it will scroll to the row where the first TD text has "323" in it. Similarly, you can use other selectors. if you have primaryKey set in the grid, it is even more straightforward:

$("#grid1_scroll").scrollTop($("#grid1").find("tr[data-id='<primary key value>']").first().position().top);

We plan to add this to the grid API in the future. Hope it helps. Thanks,

Angel


0
Alexander Todorov
Alexander Todorov answered on Jul 9, 2012 12:20 PM

The data types that can be used for columns in an MVC environment are basically part of the native .NET types – they aren't related to the JavaScript types. How they are "translated" to javascript data types, when scripts and markup is generated, is something the grid maps.

Angel

0
Alexander Todorov
Alexander Todorov answered on Mar 16, 2012 2:03 PM

Hi Suresh,

FYI – starting in 12.1, this functionality will be supported out of the box in the grid, without the need to create a template:

example:

{ headerText: 'Is Postponed', key: 'IsPostponed', dataType: 'bool', width: '200px', format: 'checkbox' }

format: 'checkbox' is the new functionality. see the attached screenshot – that's how it looks like. 

Hope it helps. Thanks,

Angel

0
Alexander Todorov
Alexander Todorov answered on Nov 15, 2011 8:32 PM

Hi,

you should use  

 $("#grid1").igGrid("dataSourceObject", pi_Data);

As described here: 

http://help.infragistics.com/jQuery/2011.2/ui.iggrid#!methods

Hope it helps. Please let me know if that's ok for you. 

Thanks,

Angel