EasyUI Forum
December 20, 2025, 06:38:33 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: know my name  (Read 9747 times)
korenanzo
Guest
« on: June 16, 2016, 07:14:34 AM »

Hi

let's say I have a combogrid, with id: 'myCombo123'


$('#xx').combogrid( {
...
id: myCombo123,
...
} )

in the combogrid I add a
Code:
onClickRow: function (index, _row) {
// do something */
var me = this; // me == 'the data grid owned by the combogrid
},
onShowPanel : function (a) {
   bla();
 var me = this; // me == 'the textfield owned by the combogrid


},


which is the most simple, secure and correct way to know, when onClickRow is executed, to know 'my name' that is 'myCombo123' ?


I've seen that I can get $(this).data('datagrid').options.id but not sure if it's the best  , even because depending to the 'on*' event, I should choose the correct object:
if I'm in onSHowPanel I'd use $(this).data('combogrid').options.id ... it's a mess!!!

Is there something unique and standard??
 
Thanks,
RIc

Logged
CLKG
Guest
« Reply #1 on: June 16, 2016, 06:30:06 PM »

Combogrid's events extend from combo and datagrid.

onShowPanel is combo's while onClickRow belongs to datagrid

use $.data(this, 'combo').options.id for onShowPanel and $.data(this, 'datagrid').options.id for onClickRow.

Hi

let's say I have a combogrid, with id: 'myCombo123'


$('#xx').combogrid( {
...
id: myCombo123,
...
} )

in the combogrid I add a
Code:
onClickRow: function (index, _row) {
// do something */
var me = this; // me == 'the data grid owned by the combogrid
},
onShowPanel : function (a) {
   bla();
 var me = this; // me == 'the textfield owned by the combogrid


},


which is the most simple, secure and correct way to know, when onClickRow is executed, to know 'my name' that is 'myCombo123' ?


I've seen that I can get $(this).data('datagrid').options.id but not sure if it's the best  , even because depending to the 'on*' event, I should choose the correct object:
if I'm in onSHowPanel I'd use $(this).data('combogrid').options.id ... it's a mess!!!

Is there something unique and standard??
 
Thanks,
RIc


Logged
korenanzo
Guest
« Reply #2 on: June 16, 2016, 11:33:15 PM »

Combogrid's events extend from combo and datagrid.

onShowPanel is combo's while onClickRow belongs to datagrid

use $.data(this, 'combo').options.id for onShowPanel and $.data(this, 'datagrid').options.id for onClickRow.


the same thing I said Smiley

I am asking for a better, linear solution ...
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!