-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
we have our own framework that is based on javascript for creating components (Textbox, Button etc) and event for that component. Now i want to integrate that in ZK framework as new coponent. But the problem is in existing framework has visual and event of the component is in single js file.
seprating display and event is a bit difficult. As i believe for creating a new component in ZK display(have to put in Mold folder web/js/mycomp/mold/*.js) and event (web/js/mycomp/*.js) is identified sepratly.
I need a help how can i integrate this. Can i have component related event & display in single js file and use it as new component in ZK.
Thanks
Satish Kumar
Hi,
One more add-on to above context. When i create a new component exmp
component.MyComp = zk.$extend(zk.Widget, {}, {});
On a html page "window" is the topmost node. so how is the hirearchy of this new component. how is the control passes from window to zk.Object to this MyComp?
Thanks
Satish Kumar
Hi Satish,
For you first question, you could just use your single js file, the "mold" folder is not a necessity; however, your component will lose the ability to have multiple molds and you will need to implement a redraw function in your single js file.
An example of a redraw function:
redraw: function(out){
out.push('<div', this.domAttrs_(), '>');
for(var w = this.firstChild; w; w = w.nextSibling)
w.redraw(out);
out.push('</div>');
}
For your second question, consider:
zk.Object <-- zk.Widget <-- zul.Widget <-- zul.inp.InputWidget
zk.Object <-- zk.Widget <-- zul.Widget <-- zul.LabelImageWidget <-- zul.mesh.HeaderWidget
cheers
Asked: 2010-03-12 04:59:51 +0800
Seen: 331 times
Last updated: Mar 15 '10