EasyUI Forum
September 13, 2025, 04:23:32 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: onBeginedit in treegrid cannot clear value editor  (Read 18526 times)
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« on: January 13, 2015, 09:53:36 PM »

afternoon all,

i have a problem with clearing element value, in this case is combogrid.
here is my code :
Code:
onBeginEdit:function(index,row){
        if (state.row == 'new_row'){
          var id_modul = $(this).treegrid('getEditor',{id:row.id_tree, field:'id_modul'});
          $(id_modul.target).combogrid('clear');
          console.log('opan');
        }
      },

as you can see, i already defined clear method for combogrid but the text still appear, or how to make combo element when his value is empty or null, the text element will empty too. because in my project some combo element won't clear his text when value is empty.

how to solve this issue?

many thanks for the answer.
« Last Edit: January 13, 2015, 10:22:39 PM by Opan Mustopah » Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 14, 2015, 08:12:40 AM »

Please refer to this example http://jsfiddle.net/tn8qn2n5/. Before using that please download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4.1-patch.zip
Logged
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #2 on: January 14, 2015, 08:38:35 AM »

thanks stworthy for your replay,

about the patch is it oke when i'm using version 1.4?
Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #3 on: January 14, 2015, 07:31:04 PM »

this still not working,
and thrown me a new error.
see bug combogrid1.png

and i already include the patch

see already include.png

and this onbeforeedit to clear combo element is not working too in datagrid.

here my code:

Code:
onBeginEdit:function(index,row){
        var port_host_id = $(this).datagrid('getEditor',{index:index,field:'port_host_id'});
        if (state.row == "new_row"){
          $(port_host_id.target).combogrid('clear');
          console.log(port_host_id.target);
        }
      },

Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: January 15, 2015, 12:38:02 AM »

If you are using easyui 1.4, please download the corresponding patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4-patch.zip.
Code:
onBeginEdit:function(row){
  var id_modul = $(this).treegrid('getEditor',{id:row.id_tree, field:'id_modul'});
  //...
}
Logged
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #5 on: January 15, 2015, 01:58:33 AM »

thanks stworthy for the patch, but after i include that file into my project, i got error row is undefined, in fact onBeginEdit has parameter row and index,

see bug clear combogrid.png

as you can see, i try to debug what is content of row object. and i got undefined.

Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #6 on: January 15, 2015, 03:59:35 AM »

i'm sorry stworthy about the error row is undefined. its my mistake.
but back to the problem , i still can not clear combo element.
i'm sure i already inlclude your patch file.
Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #7 on: January 15, 2015, 07:24:56 AM »

Please refer to this example http://jsfiddle.net/tn8qn2n5/. Select the 'Coding' row and click the 'Edit' button, the combogrid editor will clear its value.
Logged
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #8 on: January 15, 2015, 09:11:13 AM »

did you already try your example in firefox? because when i try your example in chrome its work fine, but when i run in firefox, combogrid won't clear it's value.

i almost depression with this.
Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #9 on: January 15, 2015, 07:58:25 PM »

Yes, it works fine in firefox browser. Please try to refresh your page and then run this example again.
Logged
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #10 on: January 16, 2015, 01:04:07 AM »

okay stworthy.
many thanks for your help.
Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
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!