Hi,
I want to use databinding event, but nothing is getting fired. Below is the code:
//Initialize $("#mGrid").igGrid( { //databinding event dataBinding: function(evt, ui){ alert("do something"); }});
});
Any help would be appreciated.
Hello sanjaysutar ,
Thank you for posting in our forums.
The only issue in your code snippet is the syntax error (there are too many brackets, and the semicolon is not needed) :
//Initialize
$("#mGrid").igGrid( {
.......
//databinding event
dataBinding: function(evt, ui){
alert("dataBinding do something");
},
.....
Please refer to the API documentation:
http://help.infragistics.com/jQuery/2012.1/ui.igGrid#events
Hope this helps.
Tried below code as per your suggestion:
$("#mGrid").igGrid( { //databinding event dataBinding: function(evt, ui){ BlockUI(); },
//rendered event rendered: function(evt, ui) { UnBlockUI(); }
Still it does not work.
Thank you for the update.
What dataSource do you bind the grid to?
Can you provide us with a small isolated sample or at least the full definition of the igGrid?
Also keep in mind that rendered event is fired only when the grid is being initialized.
It will not be fired if the grid is rebound to its data (for example, when calling the dataBind() API method or when changing the page size.
Hope hearing from you.
Hi Tsvetelina,
I have List<Measure> that I am binding. Below is the complete MVC helper code:
@(Html
.Infragistics() .Grid<Measure>(Model.Measurements.AsQueryable()) .ID("mGrid") .AutoGenerateColumns(true) .FixedHeaders(false) .Features(features => { features.Paging().PageSize(50).Type(OpType.Local); features.Selection().Mode(SelectionMode.Row).MultipleSelection(false).Activation(true); features.Filtering().Mode(FilterMode.Advanced).CaseSensitive(true); features.Sorting(); features.Resizing(); }) .Height("600px") .DataBind() .Render() )
Below is the javascript for igGrid events:
<script type="text/javascript"> $(document).ready(function () {
$("#mGrid").igGrid( { //databinding event dataBinding: function(evt, ui){ alert('hi'); }, //rendered event rendered: function(evt, ui) { alert('hi'); }
</script>
Basically I want to show some wait window or progress window while the grid is getting loaded or populating data. Hence I need events for that.
Hello,
The way that you binding to events is used on initialization.
As I can see you are using the MVC helper to define the igGrid so you should bind the events after initialization.
In this case the depending on your situation you may choose to use the bind(), live(), delegate() or on() functions to wire event handlers to a widget's events.
http://help.infragistics.com/NetAdvantage/jQuery/2012.2/CLR4.0?page=Using_Events_in_NetAdvantage_for_jQuery.html
Please refer to the sample regarding this
http://ko.infragistics.com/products/jquery/sample/grid/grid-api
Let us know if you need further assistance.