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

Support client data attributes handler

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 8.0.0
    • None
    • Components
    • None
    • ZK 8.0.1

      the developer can add some extra functionality to the original component.
      For example, we add jquery's mask to support for the textbox component.

      <textbox xmlns:ca="client/attribute" ca:data-mask="00:00:00" onChange='Clients.log(self.value)'/>
      

      And the handler of the data-attribute can predefine in a zk.xml file.
      For example,

      <client-config>	
      	<data-handler>
      		<name>mask</name><!-- the attribute name, i.e. data-mask -->
      		<depends>http://igorescobar.github.io/jQuery-Mask-Plugin/js/jquery.mask.min.js</depends>
      		<script>
      		function (wgt, dataValue) {
      			jq(wgt.$n()).mask(dataValue);
      			wgt.listen({onChange: function (event) {
      				event.data.value = jq(this.$n()).cleanVal();
      			}});
      		}
      		</script>
      	</data-handler>
      </client-config>
      

            jumperchen jumperchen
            jumperchen jumperchen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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