EasyUI Forum
May 15, 2024, 03:08:30 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / how to get the field name inside an styler function? on: February 12, 2019, 08:01:41 AM
this post :https://www.jeasyui.com/forum/index.php?topic=4940.msg12207#msg12207
is  become invalid。
when i console.log(this) in the styler function ,i print the table .

in the old versions ,  datagrid call styler directly , now it use  styler.call('datagridTarget',...).

can styler  add a field param after (value,row,index,...)?
2  General Category / EasyUI for React / may i get the keydown event from TextBox or PasswordBox on: January 25, 2019, 06:10:03 AM
when input the password in the login page , user usually input Enter(key=13) to login .

the jquery version is here:
https://www.jeasyui.com/forum/index.php?topic=5569.0

how can i do this in react version?
3  General Category / EasyUI for React / how to use i18n in easyui for react on: January 25, 2019, 05:46:28 AM
in jquery version ,there is "easyui-lang-zh_CN.js", how can i do i18n  in react version ?
4  General Category / General Discussion / reload combobox when it's depend field change in an common way on: April 20, 2015, 09:04:52 PM
I add dependForm and dependFields attributes  to field collegeCode.
Code:
<form id="courseListForm" method="post">
<input class="easyui-combobox" id="collegeCode"  name="collegeCode"  style="width:250px"
multiple="multiple"  valueField="code" textField="shortName"
url='${appPath}/college/collegeListData.do'/>

<input class="easyui-combobox" id="collegeCode"  name="collegeCode"  style="width:250px"
multiple="multiple" dependForm="courseListForm" dependFields="termCode" valueField="code" textField="shortName"
url='${appPath}/college/collegeListData.do'/>
other fields...
</form>
after parser onComplete , I call the Component's extParse method if exits
Code:
$.parser.onComplete= function(context){
for(var i=0; i<$.parser.plugins.length; i++){
var name = $.parser.plugins[i];
var r = $('.easyui-' + name, context);
if (r.length){
if (r[name]&&r[name].methods.extParse){
r[name]('extParse');

}
}
}
then i extend an method to combobox
Code:
$.extend($.fn.combobox.methods, {
extParse: function(jq){
jq.each(function(){
var _this = $(this);
//default value
var defaultExtOptions = {
dependForm:null,
dependFields:null,
};
        //markup value
var markupOptions = {
dependForm:_this.attr('dependForm'),
dependFields:_this.attr('dependFields'),
};

//megre extOptions
        var extOptions = $.extend(defaultExtOptions,markupOptions);
       
        if(extOptions.dependFields){
        //register event
        var  dependFields = extOptions.dependFields.split(',');
        for(var i in dependFields){
        //**************************************************
        $('#'+dependFields[i]).textbox('options').onChange=function(){
        _this.combobox('reload');
        };
        }
        }
       
        if(extOptions.dependForm){
        _this.combobox({
        onBeforeLoad: function(param){
        var formData = $("#"+extOptions.dependForm).formToObject();
        $.extend(param,formData);
        }
        });
        }
});
    }
});

the line below many '*****',have errors,so the question is :
combobox extends combo
combo extends textbox.
can i call the parent's 'options' method to get the current options ?
because i can't know ,what the depended component type is
5  General Category / General Discussion / can i bind event to component after markup init ? on: April 19, 2015, 06:15:14 PM
I like the markup style very much,component can be declare by html with less javascript.
the html is readable , the javscript block is clear.

but, i have an obsession for javacirpt in html : I don't want any javascript code in the html markup.
the best style I want  is like this:
the html code:
Code:
<div id='the_id'  data-options= 'only options here ' class='esayui-component-name'
then the javascript code:
Code:
   $('#the_id').component-name('bind','eventName',function(){
         event handler...
   })
is it possible without javascirpt code init but can bind event after component  init ready?
6  General Category / General Discussion / Re: combobox show value (but not text) after init twice on: April 12, 2015, 11:23:01 PM
is there any way to bind event Listener after parse?
the basic reason is :
I want to use markup style to init combobox,it make javascript code clear,
but i don't want to  write javascript code in markup, it makes html dirty.

so i want to bind onChange event after parse in javascirpt.
7  General Category / General Discussion / combobox show value (but not text) after init twice on: April 12, 2015, 07:27:22 PM
for example , use the file in easyui release demo :jquery-easyui-1.4.2/demo/combobox/basic.html
I want to register an event for the commbox,
but I don't want to write any javascript code in html element's markup like : data-options='onChange:function(){...}'
so I write code like this:

Code:

$(document).ready(function() {

$('#state').combobox({
onChange:function(){
console.log('ok');
}
});
});


then , the combobox show the selected option's value 'AK',but not 'Alaska'。

dose the combobox can't be init twice ?


8  General Category / General Discussion / Re: how to append properties or event handler after parse on: February 06, 2015, 01:30:24 AM
it works! thank you!
(I worried about it may init twice before.  Smiley)


9  General Category / General Discussion / how to append properties or event handler after parse on: February 04, 2015, 04:35:57 AM
I am a newer to easyui.

I like markup type to define widget like this:
Code:
<div id='tt' class="easyui-tabs" style="width:700px;height:250px" data-options="...">
<div title="APanel"  ></div>
<div title="BPanel"  ></div>
<div title="CPanel" ></div>
</div>


I know the basic way to handle events is write a javascript method in the data-options.
it seems not easy to wirte an javascript function in a html attribute with other options as a long string.
May i add an event handler and ohter options to the markuped  widget  by javascript in $(document).ready functions  after parse?

just like this (some thing i imagine) :

Code:
$(document).ready(function() {

  $('#tt').tabs.('options','fit',true);// set the options

  $('#tt').tabs.('event','select',function(){
          xxx
  }); //set the event


});
 
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!