EasyUI Forum
December 08, 2025, 03:03:26 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Get parent from grid which throws an event  (Read 11716 times)
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« on: October 18, 2012, 12:57:30 AM »

Is it possible to retrieve the original ID of the table or input on which the grid is created ?

For example:

HTML
Code:
<input id='studentSearch' class='personSearch' searchType='student'/>
<input id='teacherSearch' class='personSearch' searchType='teacher'/>

......

JAVASCRIPT
Code:
jQuery('.personSearch').combogrid('grid').datagrid({onSelect: function(rowIndex, rowData){
   var calledById = ....?
   var searchType = ....?

Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 18, 2012, 08:44:14 PM »

Try the following code:
Code:
$('.personSearch').each(function(){
var target = this;
$(target).combogrid('grid').datagrid({
onSelect: function(index,row){
var searchType = $(target).attr('searchType');
//...
}
});
});
Logged
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« Reply #2 on: October 19, 2012, 12:29:35 AM »

I used this method to create al 'empty' combogrids, I never thought about using this same method for the events Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!