create properties(Dropdownlist,Editor,ComboBox) in WavaMaker

| ไอที | WaveMaker | 2186

How to create properties(Dropdownlist,Editor,ComboBox) in WavaMaker


Example :
When we want to create a property name "displayStyle" in my custom component/widget the first step is :
dojo.declare("wm.jquery.datepicker",wm.Text, { 
//inherit with wm.Text  ,in the example we use wm.jquery.datepicker
//that is my widget control jquery datepicker
	displayStyle: "default", 
	//set default this property "default"
	//{....yourcode....}
});
Step 2:We must determine "extendSchema" to adjust anything about showing your property. add this script after step first
wm.Object.extendSchema(wm.jquery.datepicker, { 
	//{....yourcode....}
	displayStyle: { ignore:false ,type: "String", group: "Datepicker",shortname:"dateModel"},
	//{....yourcode...}
});

Finally step:Customize your property provide to display in DropDownList/Editor/ComboBox.add this script after step 2
wm.jquery.datepicker.extend({
	makePropEdit: function(inName, inValue, inDefault) {
		switch (inName) {
			case "displayStyle":
				return makeSelectPropEdit(inName, inValue, ["default", "inline", "icon-trigger"], inDefault);
		}
		return this.inherited(arguments);
	}
})

now,we have custom property in your custom widget/component that has 3 values "default", "inline", "icon-trigger"
Sorry,For my English Grammar.

Thanadit Buthong
[email protected]


comments




เว็บเพื่อนบ้าน
DoesystemDevcodeMathMySelfHowToClicksBlogJavaExample