Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1983

add a "today" button to datebox's calendar popup

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: 7.0.0
    • Fix Version/s: 8.0.0
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:
    • gh.sprint.customfield.default.name:
      ZK 8.0.1

      Description

      a button in the calendar popup of datebox to jump to today

      this example shows a prototypic implementation, based on ZK 6.5.4, but feature is not required before ZK7

      • the "today"-link might be an icon or needs further localization, when text based
      • it should be possible to enable/disable the button
       
      <zk>
      	<script>
      	zk.afterLoad('zul.db', function () {
      	
      		var _xRenderer = {};
      		zk.override(zul.db.Renderer, _xRenderer, {
      			titleHTML: function (wgt, out, localizedSymbols) {
      				_xRenderer.titleHTML.apply(this, arguments); //call the original method
      				var uuid = wgt.uuid,
      				    view = wgt._view,
      				    text = wgt.getZclass() + '-ctrler';
      				    
      				if(view == 'day') {
      					out.push('&lt;span id="', uuid, '-today" class="', text, '"', 
      						' onClick="var cal = zk.Widget.$(\'$', wgt.parent.id, '\')._pop; cal._value = null; cal._setTime();"',
      						' &gt;', ' today', '&lt;/span&gt;');
      				}
      			}
      		});
      	});		
      	</script>
      	<datebox id="db" onChange=""></datebox>
      </zk>
      

        Attachments

          Activity

            People

            • Assignee:
              ChunfuChang ChunfuChang
              Reporter:
              cor3000 cor3000
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 2 hours
                1d 2h