Show Posts
|
Pages: 1 2 [3] 4 5 ... 7
|
31
|
General Category / EasyUI for jQuery / [SOLVED] remove dynamically created tooltip
|
on: February 26, 2020, 06:26:41 PM
|
5 cell in datagrid have dynamically created tooltip after watching 100 pages with 100 rows per page html have ~50 000 <div tabindex="-1" class="tooltip" ... but function dgOnBeforeLoad(){ $('#dg').datagrid('getPanel').find('.easyui-tooltip').tooltip('destroy'); } didn work ;( // create tooltip: function dgOnRowsLoad(){ $('#dg').datagrid('getPanel').find('.easyui-tooltip').tooltip({showDelay: 100 }); };
|
|
|
32
|
General Category / EasyUI for jQuery / Re: datebox calendar error
|
on: February 07, 2020, 06:12:10 PM
|
Thnx 4 reply! My advice: datebox.js // ... // line 62 $.extend(state.calendar.calendar('options'), { fit:true, border:false, onSelect:function(date){ var target = this.target; var opts = $(target).datebox('options'); var calendar = $(target).datebox('calendar'); // + opts.onSelect.call(target, date); calendar.calendar('moveTo', date); // + setText(target); // + // - setValue(target, opts.formatter.call(target, date)); $(target).combo('hidePanel'); } }); // ... // line 128 function doEnter(target){ var state = $.data(target, 'datebox'); var opts = state.options; var current = state.calendar.calendar('options').current; if (current){ setText(target); // + $(target).combo('hidePanel'); // - setValue(target, opts.formatter.call(target, current)); } }
function setValue(target, value, remainText){ var state = $.data(target, 'datebox'); var opts = state.options; var calendar = state.calendar; calendar.calendar('moveTo', opts.parser.call(target, value)); if (remainText){ $(target).combo('setValue', value); } else { setText(target); // + // - if (value){ // - value = opts.formatter.call(target, calendar.calendar('options').current); // - } // - $(target).combo('setText', value).combo('setValue', value); } }
function setText(target){ // + var state = $.data(target, 'datebox') , opts = state.options , calendar = state.calendar , value = opts.formatter.call(target, calendar.calendar('options').current) ; $(target).combo('setText', value).combo('setValue', value); } }
// ... // line 224 setDate: function(jq, date){ return jq.each(function(){ var opts = $(this).datebox('options'); $(this).datebox('calendar').calendar('moveTo', date); // - setValue(this, date ? opts.formatter.call(this, date) : ''); setText(this); // + }); },
|
|
|
33
|
General Category / EasyUI for jQuery / Re: datebox calendar error
|
on: February 06, 2020, 06:40:32 PM
|
Thnx 4 answer, and your patience why calendar use parser after user choose ? why setDate use parser after use formatter ? http://code.reloado.com/atorub3/20/edit#sourceif defined only formatter - datetimebox didnt work! my English level is poor (this language is not my native) I want to give advice to change internal actions of CalendarChoose and setDate to did not parse (use 'parser') of the text which the this functions just now generated.
|
|
|
35
|
General Category / EasyUI for jQuery / Re: datebox calendar error
|
on: February 02, 2020, 06:08:27 PM
|
Thnx 4 reply!
in Your version 15 :
'formatter' do convert from dateObject to String "DD MMM HH:MM" and 'parser' do convert from String "DD MMM HH:MM" to DateObject
and all work fine!
in my version
'formatter' do convert from dateObject to String "DD MMM HH:MM" and 'parser' do convert from String "YYYY-MM-DD HH:MM:SS" to DateObject ( editable: false - so user cant edit value in box, only choose datetime from calendar )
and when I do ('setDate',DateObject) the error in parser ! I dont understand why setDate use 'parser'
setDate (maybe) can do: set local Date variable and use only formatter to set visible value! why it use 'parser' ? and calendar (maybe) can do only ('setDate',DateObject) // but now it use formatter for generate correct visible string AND then it use parser to parse this generated string to dateObject !!
|
|
|
37
|
General Category / EasyUI for jQuery / Re: datebox calendar error
|
on: January 28, 2020, 07:37:16 PM
|
may be datetime('setDate',DateObject) -> set internal aDate variable and setText via formatter(dateObject) datetime('getDate') -> get internal aDate variable datetime('setValue',text) -> set internal aDate variable via parser(aText) and setText via formatter(dateObject) datetime('getValue') -> getText and Calendar -> (setDate, DateObject) (-> set internal aDate variable and setText via formatter(dateObject) ) now when I do ('SetDate',DateObject) // new Date().mySQLparser('1999-01-02 03:04:00') widget do internal call ->formatter // 02 Jan 03:04 and then -> parse from TextBox // error because my parser NOT FOR format 'DD mmm HH:MM' // and if I do formatter for 'DD mmm HH:MM' in result year == 2020 !
|
|
|
38
|
General Category / EasyUI for jQuery / Re: datebox calendar error
|
on: January 28, 2020, 06:44:53 PM
|
Thanx for answer, but: function setValue(){ var mySQLdate = "1999-01-02 03:04:00"; var date = new Date().parseMySQL(mySQLdate); var m = date.getMonth(); var d = date.getDate(); var v = (d<10?('0'+d):d)+' '+monthNames[m]; $('#dt').datebox('setValue', v); alert($('#dt').datebox('getDate')) } Thu Jan 02 2020 00:00:00 =/= "1999-01-02 03:04:00" and didnt work setDate|getDate when parser and formatter have different format How do datetime widget to store date via parser (setValue) and setDate as date object in internal widget variable? and getDate is return dateObject from internal variable ?
|
|
|
40
|
General Category / EasyUI for jQuery / datebox calendar error
|
on: January 21, 2020, 05:04:19 PM
|
datebox: , formatter:fmtShrtDate , parser:parseMySQLDate
function fmtShrtDate(aDate){ // DateObject -> "DD MMM" return dateFormat(aDate,"dd mmm") }; function parseMySQLDate(sqlDate){ // "YYYY-MM-DD[[ HH:MM]:SS]" -> DateObject return new Date().parseMySQL( sqlDate + ((sqlDate.length==16)?':00':((sqlDate.length==10)?' 00:00:00':'')) ) };
why calendar use datebox.parse (setValue ?) to set date ? May be it use newest datebox('setDate') ? http://code.reloado.com/atorub3/4/edit#preview
|
|
|
43
|
General Category / EasyUI for jQuery / Re: datebox getValue as Date object
|
on: January 07, 2020, 01:43:05 PM
|
Thnx for reply, and very interesting code but: $('#db').datebox('setValue','2010-11-01 12:30:00') var d = $('#db').datebox('getDate'); alert(d.toString()); result is Mon Jun 11 2187 00:00:00if I change parser for mySQL date parse then it didnt work for "dd mmm HH:MM" format. solve for this is use another parserFunction inside getDate method BUT information about year is lost. Does it exist access to datebox object from inside formatter? For example for set $(datebox).prop('Date',date) and extract it from getDate method ( return jq.datebox.prop('Date') ) ?
|
|
|
44
|
General Category / EasyUI for jQuery / Re: datebox getValue as Date object
|
on: December 31, 2019, 11:32:09 AM
|
Thnx for Your reply, but: I use my parser for decode mySQL datetime format function parseMySQLdate(aDate){ var matches = aDate.match(/^\s*(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})\s*$/) , lDate = new Date() ;
if(matches){ var Y = parseInt(matches[1],10) , M = parseInt(matches[2],10) - 1 , D = parseInt(matches[3],10) , H = parseInt(matches[4],10) , N = parseInt(matches[5],10) , S = parseInt(matches[6],10) ; lDate.setDate(D); lDate.setMonth(M); lDate.setFullYear(Y); lDate.setHours(H); lDate.setMinutes(N); lDate.setSeconds(S);
}
return lDate; }
so it`s not suitable for... and db.datebox('getValue'); return string without year (because my formatter is dateFormat(aDate,"dd mmm HH:MM") ) is there a possibility to store date as Date object in date[time]box inside formatter or inside ('setValue') and get it as Date object from ('getValue') ? OR maybe add .datetimebox('getDate') .datetimebox('setDate',DateObject) ?
|
|
|
|