This is a migrated thread and some comments may be shown as answers.

How to Fetch Current Row info of Kendo Grid from onClick event of ComboBox ?

1 Answer 3232 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mohammed Nazrul
Top achievements
Rank 1
Mohammed Nazrul asked on 29 Aug 2013, 01:07 PM
Hello Kendo Team,

I am using Kendo Combo Box under Kendo Grid. Now i need to fetch current row data or array of Kendo Grid onClick event of ComboBox ?

In short meaning, OnClick event of ComboBox , I need to fetch data of current row of Kendo Grid. I can not do this and data of current row can be not fetched.

======================
Kendo ComboBox Event:
======================
  
        transport: {
                read: {
                    type: "POST",
                                                            dataType: "json",
                    data: function(e){
                    //alert(e.toSource());
                    var grid = $("#grid").data("kendoGrid");
                    var rowDataItem = grid.dataItem(grid.tbody.find("tr"));   /* I need Current Row */
                    alert(rowDataItem.toSource());
                    },
                    url: "<?php echo $this->url( array('module'=> 'Invoice', 'controller' => 'backend', 'action' => 'gateway' ), 'adminrout',    true); ?>"
                }
            }

grid.dataItem(grid.tbody.find("tr"))  is not working.  How to get the current row array ? 

Please See the Screen Shot and Code sample attached herewith for your better understand.
Please help where is my mistake or can you give us a sample code ?

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 02 Sep 2013, 07:13 AM
Hi Mohammed,

I would suggest to try to get the closest "tr" element from the currently clicked element:

//you can select current row using the current sender closest Tr element
var rowDataItem = grid.dataItem(this.closest("tr"));   /* I need Current Row */

Kind Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Mohammed Nazrul
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or