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

Support client data attributes handler

    Details

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

      Description

      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>
      

        Activity

        Hide
        jumperchen jumperchen added a comment -

        Ready since 4/24/2015.

        Show
        jumperchen jumperchen added a comment - Ready since 4/24/2015.
        Show
        jumperchen jumperchen added a comment - Add the document - http://books.zkoss.org/wiki/ZUML_Reference/ZUML/Namespaces/Client_Attribute#Data-Attribute_Handler

          People

          • Assignee:
            jumperchen jumperchen
            Reporter:
            jumperchen jumperchen
          • 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, 5 hours, 30 minutes
              1d 5h 30m

                Agile