WinFormsãšåæ§ã«ãjsFormsã§ã¯ãã¹ãŠãã³ã³ããŒãã³ãäžã«æ§ç¯ãããŸãã ããã§ã¯å§ããŸãããã
æå
ã³ã³ããŒãã³ãã¯2ã€ã®éšåã§æ§æãããŸãã- ããžã¥ã¢ã«
- æ©èœç
èŠèŠéšå
ããžã¥ã¢ã«ããŒãã¯ãHTMLããŒã¯ã¢ãããå«ã¿ãããããã£ãšã€ãã³ããèšå®ãããã³ãã¬ãŒãã§ãã
ãã³ãã¬ãŒãã¯ã次ã®åœ¢åŒã®jsãã¡ã€ã«ã§ãã
jsForms.Templates.ComponentType='HTML';
- ComponentType-ã³ã³ããŒãã³ãã®ã¿ã€ã
- [HTML]-åŒçšç¬Šã§å²ãŸããHTMLã³ãŒã
éèŠ -HTMLã³ãŒãã§ã¯æåã<ãããã³ã>ãã䜿çšããŠã¿ã°ããã¬ãŒã åããä»ã®å Žæã§ã¯ãïŒlt;ãã䜿çšããŸã ããã³ïŒgt; ããã«å¿ããŠã
HTMLã¿ã°ã¯éåžžã«å³å¯ã§ããå¿ èŠããããŸããã€ãŸãããã¹ãŠã®éããŠããã¿ã°ãéããŠãé åºã«åŸãå¿ èŠããããŸãã
ãã³ãã¬ãŒãã«ã¯ãã«ãŒãhtmlã¿ã°ã1ã€ã ãå«ããå¿ èŠããããŸãã
æ©èœéš
æ©èœéšåã¯ãã³ã³ããŒãã³ãã®ããããã£ãšã€ãã³ãã宣èšããã ãã§ãªãããã¯ã©ã¹ããå«ãjsãã¡ã€ã«ã§ããããŸãã
æ©èœéšåã®åœ¢åŒã¯æ¬¡ã®ãšããã§ãã
jsForms.Components.ComponentType=<br/>
{<br/>[JavaScript]<br/>};<br/>
- ComponentType-ã³ã³ããŒãã³ãã®ã¿ã€ã
- [JavaScript]-éåžžã¯ã¯ã©ã·ãã¯JS
jsFormsã䜿çšãã
äŸãèŠãŠã¿ãŸãããã
ããšãã°ããã¿ã³ã®ãã³ãã¬ãŒããã¡ã€ã«ã¯æ¬¡ã®ããã«ãªããŸãã
jsForms.Templates.Button=' < div class ="button" > '+<br> ' < div class ="button-background" > '+<br> ' < div class ="button-common button-w" /> '+<br> ' < div class ="button-common button-e" /> '+<br> ' </ div > '+<br> ' < span name ="text" class ="button-text" /> '+<br>' </ div > '; <br><br> * This source code was highlighted with Source Code Highlighter .
æå
ãã³ãã¬ãŒãå ã®ä»ã®ã³ã³ããŒãã³ãã䜿çšããã«ã¯ãã¿ã°ã䜿çšããŸãïŒã³ã³ããŒãã³ã
ãŸãããã³ãã¬ãŒãã«ä»ã®ã³ã³ããŒãã³ããå«ãŸããã³ã³ããŒãã³ãã¯ãã³ã³ãããšåŒã°ããŸãã
ã³ã³ããŒãã³ãã¿ã°ã®åœ¢åŒã¯
< component [ name ='ComponenName' ][ id ='IdValue' ][ class ='CSSClass' ] > [Settings] </ component > <br><br> * This source code was highlighted with Source Code Highlighter .
- ComponentType-ã³ã³ããŒãã³ãã®ã¿ã€ã
- ComponenName-ã³ã³ããŒãã³ãåããªãã·ã§ã³ã®ãã©ã¡ãŒã¿ãŒã«ã€ããŠã¯ä»¥äžã§èª¬æããŸã
- id-htmlã¿ã°ã®idããããã£ãèšå®ããŸã
- class-htmlã¿ã°ã«é¢ããã¯ã©ã¹ããããã£ãèšå®ããŸã
- èšå®-åŸã§èª¬æããã¿ã°ã®ã»ãã
ããã¹ããš2ã€ã®ãã¿ã³ãå«ããã€ã¢ãã°ããã¯ã¹ã®äŸã調ã¹ãŠã¿ãŸãããã
jsForms.Templates.InsertCSSDialog=' < div > '+<br> ' < div > Test text </ div > '+<br> ' < component type ="Button" /> '+<br> ' < component type ="Button" /> '+<br> ' </ component > '+<br>' </ div > '; <br><br> * This source code was highlighted with Source Code Highlighter .
ãããã質åã¯ãã¿ã³ã®ååãã©ã®ããã«èšå®ããã®ã§ããïŒ
ã³ã³ããŒãã³ãã®ããããã£ãèšå®ããã«ã¯ãããããã£ã¿ã°ã䜿çšããŸãã
ç©æ§
ããããã£ã¿ã°ã«ã¯ãã³ã³ããŒãã³ãã®æå®ããããã¹ãŠã®ããããã£ãå«ãŸããåæã¯ããŒã¿ã°ã䜿çšããŠè¡ãããŸã
ããŒã¿ã°ã®åœ¢åŒã¯
< key name ="PropertyName" [ value ="PropertyValue" ][ type ="object|string|int|float..." ][ disable ][ direct ][ const ] > [PropertyValue] </ key > <br> <br> * This source code was highlighted with Source Code Highlighter .
- PropertyName-ããããã£åãå¿ é ãã©ã¡ãŒã¿ãŒ
- PropertyValue-å€ã¯valueå±æ§ãŸãã¯ããŒã¿ã°å ã§æå®ããå¿ èŠããããŸããå±æ§ã¯åªå é äœã§ã
- type-å€ã®ã¿ã€ãããªãã·ã§ã³ã®ãã©ã¡ãŒã¿ãŒ
- disable-å±æ§ã¯ããããã£ãèšå®ãããªãããšã瀺ããŸã
- direct-å±æ§ã¯ãããããã£ãããããã£ã®èšå®ããããã£ããã€ãã¹ããŠèšå®ãããŠããããšã瀺ããŸãããçŸåšã¯ç¡èŠãããŸã
- const-ãã®å±æ§ã¯ãå€èšèªã®å°æ¥ã®ãµããŒãã®ããã«äºçŽãããŠããŸãã
ãã®ããã«ããŠããã¿ã³ã«ãããã¹ãããèšå®ã§ããŸãã
jsForms.Templates.InsertCSSDialog=' < div > '+<br> ' < div > Test text </ div > '+<br> ' < component type ="Button" > '+<br> ' < properties > '+<br> ' < key name ="Text" value ="Ok" /> '+<br> ' </ properties > '+<br> ' </ component > '+<br> ' < component type ="Button" > '+<br> ' < properties > '+<br> ' < key name ="Text" value ="Cancel" /> '+<br> ' </ properties > '+<br> ' </ component > '+<br>' </ div > '; <br><br> * This source code was highlighted with Source Code Highlighter .
次ã«ããã¿ã³ã«ã€ãã³ããæ·»ä»ããŸããããã«ã¯ãeventsã¿ã°ã䜿çšããŸã
ã€ãã³ã
ã€ãã³ãã¿ã°ã«ã¯ãæå®ããããã¹ãŠã®ã³ã³ããŒãã³ãã€ãã³ããå«ãŸããåæã¯ããŒã¿ã°ã䜿çšããŠè¡ãããŸã
< key name ="EventName" value ="EventCallback" /> <br><br> * This source code was highlighted with Source Code Highlighter .
- EventName-ã€ãã³ãåãå¿ é ãã©ã¡ãŒã¿ãŒ
- EventCallback-ã³ã³ããã®ãã¯ã©ã¹ãã®ã³ã³ããŒãã³ãããã®ã¡ãœããã®ååã
ã³ã³ããŒãã³ãã®æ©èœéšåã«å€æŽãå ããã«ã¯ãbOk_ClickãbCancel_Clickã®2ã€ã®ã¡ãœãããè¿œå ããŸãã
jsForms.Components.InsertCSSDialog=<br>{<br> // <br> // <br> // <br> bOk_Click: function ()<br> {<br> alert( 'OK' );<br> },<br> bCancel_Click: function ()<br> {<br> alert( 'Cancel' );<br> }<br> // <br> // <br> // <br>}; <br><br> * This source code was highlighted with Source Code Highlighter .
ãã³ãã¬ãŒããå€æŽããŸã
jsForms.Templates.InsertCSSDialog=' < div > '+<br> ' < div > Test text </ div > '+<br> ' < component type ="Button" > '+<br> ' < properties > '+<br> ' < key name ="Text" value ="Ok" /> '+<br> ' </ properties > '+<br> ' < events >< key name ="onClick" value ="bOk_Click" /></ events > '+<br> ' </ component > '+<br> ' < component type ="Button" > '+<br> ' < properties > '+<br> ' < key name ="Text" value ="Cancel" /> '+<br> ' </ properties > '+<br> ' < events >< key name ="onClick" value ="bCancel_Click" /></ events > '+<br> ' </ component > '+<br>' </ div > '; <br><br> * This source code was highlighted with Source Code Highlighter .
ãã³ãã¬ãŒãã«ã¯ãã1ã€ã®éèŠãªããããã£ããããåHTMLã¿ã°ãšã³ã³ããŒãã³ãã«ååãä»ããããšãã§ããŸãã
ãã¯ã©ã¹ãã§å©çšå¯èœã«ãªããŸãã ååãèšå®ããã«ã¯ãå±æ§åãèšå®ããå¿ èŠããããŸãã ãã¹ãŠã®ã³ã³ããŒãã³ã
ãã®å±æ§ãèšå®ãããŠããªãå Žåãã³ã³ãã€ã«äžã«ã_CXããšãã圢åŒã®ååãèªåçã«çæãããŸããXã¯æ°åã
ãªããããå¿ èŠã«ãªãã®ãã¯åŸã§æããã«ãªããŸãã ã³ã³ããŒãã³ãã³ãŒãã§ååã䜿çšããæ¹æ³ã以äžã«èª¬æããŸãã
ãã®ãã³ãã¬ãŒãã䜿çšãããšã1ã€ã®ã³ã³ããŒãã³ããå¥ã®ã³ã³ããŒãã³ãã«æè³ã§ããŸãã ããšãã°ãMultiPanelã³ã³ããŒãã³ããäœæããŸãããã
ãã³ãã¬ãŒãïŒ
jsForms.Templates.MultiPanel=' < div > '+<br> ' < div class ="MPanelTop" name ="top" /> '+<br> ' < div class ="MPanelCenter" name ="content" /> '+<br> ' < div class ="MPanelBottom" name ="bottom" /> '+<br>' </ div > '; <br><br> * This source code was highlighted with Source Code Highlighter .
ãã¯ã©ã¹ãïŒ
jsForms.Components.MultiPanel={};
å 容
次ã«ããã€ã¢ãã°ããã¯ã¹ãå€æŽããŸããããŒãããã«ã®äžéšã«ãããã¹ããäžéšã«é 眮ããå ¥åãäžå€®ã«è¿œå ããŸãã
jsForms.Templates.InsertCSSDialog=' < div > '+<br> ' < component type ="MultiPanel" > '+<br> ' < content into ="top" > '+<br> ' < div > Please enter css class name </ div > '+<br> ' </ content > '+<br> ' < content > '+<br> ' < input name ="iStyleClassName" /> '+<br> ' </ content > '+<br> ' < content into ="bottom" > '+<br> ' < component type ="Button" > '+<br> ' < properties > '+<br> ' < key name ="Text" value ="Ok" /> '+<br> ' </ properties > '+<br> ' </ component > '+<br> ' < component type ="Button" > '+<br> ' < properties > '+<br> ' < key name ="Text" value ="Cancel" /> '+<br> ' </ properties > '+<br> ' </ component > '+<br> ' </ content > '+<br>' </ div > '; <br><br> * This source code was highlighted with Source Code Highlighter .
äŸãããããããã«ãcontentã¿ã°ã䜿çšããŠã1ã€ã®ã³ã³ããŒãã³ããå¥ã®ã³ã³ããŒãã³ãå ã«é 眮ã§ããŸãã
ã³ã³ãã³ãã¿ã°ã®åœ¢åŒã¯
< content [ into ="ComponentName" ] > [HTML|Component] </ content > <br><br> * This source code was highlighted with Source Code Highlighter .
- into-ã³ã³ãã³ããè¿œå ãããã³ã³ãããŒã«ã瀺ããŸããããã©ã«ãã¯ãcontentãã§ã
- [HTML |ã³ã³ããŒãã³ã]-ä»»æã®htmlã³ãŒã+ã³ã³ããŒãã³ãã
ç·šé
åã®æçš¿ããã®ç»åãæ¬è³ªã¯åããŸãŸã§ãããã解æã¡ã«ããºã èªäœãå€æŽãããŸããã
ã³ã³ããŒãã³ãã®æåã®èŠæ±ã§ããšã³ãžã³ã¯ãã®ã³ã³ããŒãã³ããã³ã³ãã€ã«ãããŠãããã©ããããã§ãã¯ããã³ã³ãã€ã«ãããŠããªãå Žåã¯ã³ã³ãã€ã«ããŸãã ãããè¡ãããã«ã圌ã¯ãã³ãã¬ãŒãã解æããããã«åºã¥ããŠjsé¢æ°ãäœæããŸãã
é¢æ°ãåŒã³åºããšãDOMã¢ãã«ãäœæãããjQueryã§ã©ãããããã³ã³ããŒãã³ãã®ãã¯ã©ã¹ãã®åºæ¬çãªæ©èœãšæ©èœããã®ãªããžã§ã¯ãã«ã¢ã¿ãããããŸããåºæ¬ã¯ãã³ã³ããŒãã³ãã³ã³ããŒãã³ãã«ãã£ãŠå®çŸ©ãããæ©èœã§ãã ã
ã€ãŸããã³ã³ãã€ã«ããå ŽåïŒ
jsForms.Templates.InsertCSSDialog=' < div id ="test" > '+<br> ' < component type ="MultiPanel" > '+<br> ' < content into ="top" > '+<br> ' < div name ="SimpleText" > Please enter css class name </ div > '+<br> ' < div > Unnamed div </ div > '+<br> ' </ content > '+<br> ' < content > '+<br> ' < input name ="iStyleClassName" /> '+<br> ' </ content > '+<br> ' < content into ="bottom" > '+<br> ' < component type ="Button" > '+<br> ' < properties > '+<br> ' < key name ="Text" value ="Ok" /> '+<br> ' </ properties > '+<br> ' </ component > '+<br> ' < component type ="Button" name ="bCancel" > '+<br> ' < properties > '+<br> ' < key name ="Text" value ="Cancel" /> '+<br> ' </ properties > '+<br> ' </ component > '+<br> ' </ content > '+<br>' </ div > '; <br><br> * This source code was highlighted with Source Code Highlighter .
åºåã§ã¯ã次ãå«ããªããžã§ã¯ããååŸããŸãã
- ããããã£
- _Type-ã³ã³ããŒãã³ãã®çš®é¡
- _Name-nameå±æ§ã§èšå®ãããã¿ã°åãŸãã¯èªåçã«çæãããã¿ã°åã
- PãŸãã¯ããããã£-ç¹å®ã®ãªããžã§ã¯ãã®ããããã£ãæ ŒçŽããããã«èšèšãããããã©ã«ãã®ç©ºã®ãªããžã§ã¯ã
- EãŸãã¯ã€ãã³ã-ç¹å®ã®ãªããžã§ã¯ãã®ã€ãã³ããæ ŒçŽããããã«èšèšãããããã©ã«ãã®ç©ºã®ãªããžã§ã¯ã
- CãŸãã¯ã³ã³ããŒãã³ã-jQueryã§ã©ããããããã¹ãŠã®ã¿ã°ãšã³ã³ããŒãã³ããå«ããªããžã§ã¯ãããã®äŸã§ã¯nameå±æ§ã§ããŒã¯ãããŠããŸã
C = {- ã·ã³ãã«ããã¹ã
- iStyleClassName
- bãã£ã³ã»ã«
- JQueryãªããžã§ã¯ãã¡ãœãã
- è¿œèš
- appendTo
- èŠãã
- ãªã©
- ã³ã³ããŒãã³ãã¡ãœãã
- Init-ã³ã³ããŒãã³ããDOMã«è¿œå ããåŸããŠãŒã¶ãŒã«ãã£ãŠåŒã³åºãããã³ã³ããŒãã³ãã®åæå
- _GetPropertyïŒnameïŒ-ããããã£ãååŸ
- _SetPropertyïŒååãå€ïŒ-ããããã£ã®èšå®
- _SetEventïŒnameãobjãfuncïŒ-ã€ãã³ããèšå®ããŸãããªããžã§ã¯ãïŒobjïŒãšããã«å«ãŸããé¢æ°ïŒfuncïŒãæå®ããå¿ èŠããããŸã
- _GetEventïŒnameïŒ-æ§é {objãfunc}ãååŸããŸã
- _ExecEventïŒååãåŒæ°ïŒ-ã€ãã³ããå®è¡ããŸããåŒæ°ã¯1ã€ã§ãªããã°ãªããŸããããå¿ é ã§ã¯ãããŸããã
- ã³ã³ããŒãã³ãã¡ãœãã
- bOk_ClickïŒïŒ-ãŠãŒã¶ãŒé¢æ°
- bCancel_ClickïŒïŒ-ãŠãŒã¶ãŒé¢æ°
- ãªã©
ãŸããã³ã³ããŒãã³ãèªäœã®DOMãªããžã§ã¯ãã«ã¯ãªããžã§ã¯ããžã®åç §ãå«ãŸããŠããã_OBJããããã£ã«æ ŒçŽãããŠããããšãç¥ã£ãŠããå¿ èŠããããŸãã
document.getElementByIdïŒ 'test'ïŒ._ OBJ-ã¯ã©ã¹InsertCSSDialogã®ç¹å®ã®ãªããžã§ã¯ããšçãããªããŸãã
ããåçŽãªã¬ã³ãŒãã®å Žåã¯ãjsForms.GetObjectïŒèŠçŽ ïŒã䜿çšããç¹å®ã®ã¿ã€ãã®ã³ã³ããŒãã³ããæ€çŽ¢ããããšããå§ãããŸã
jsForms.GetObjectByTypeïŒèŠçŽ ãfoundTypeïŒ
æ©èœéšåã®å®è£
次ã«ãå ·äœçã«æ©èœéšåã®èšè¿°ã«ç§»ããŸãã
jQueryã§éåžžã«ããŸãå®è£ ãããŠããããã§ãŒã³ãã¢ãããŒãã䜿çšããããšããå§ãããŸãããã®ãããåã¡ãœããã®æåŸã«ãèªèº«ãžã®ãã€ã³ã¿ãŒãè¿ããŸã[ãããè¿ã; ]ã
ãŸããããŒã¿ã«ç¹å¥ã«å²ãåœãŠãããå Žæãã€ãŸãthis.P. <PropertyName>ã䜿çšããŠãããããã£ãä¿åããŸãã
ã¡ãœãããšããããã£åã«å€§æåãä»ããŸã-ããã«ãããjQueryã¡ãœãããéè€ããã®ãé²ããŸãããããŒã¹ãªããžã§ã¯ããjQueryãšãã®ãã©ã°ã€ã³ã§ããããšã«æ³šæããŠãã ããããã©ã°ã€ã³ã®ã¡ãœããã®ååã¯å€§æåã§å§ãŸãããšããããŸããããªãã¯ç·åŒµããïŒ
Initã¡ãœãããããªãŒããŒããŒããããå ŽåãããŒã¹ã¯ã©ã¹ãžã®åŒã³åºã[return jsForms.Components.Component.Init.callïŒthisïŒ;]ãæåŸã«æ¿å ¥ãããã¹ããããã³ã³ããŒãã³ããåæåããå¿ èŠããããŸãã
this.Cããããã£ã«ã¯ãã¿ã°ããã³ãã¬ãŒãã®ä»ã®ã³ã³ããŒãã³ããã©ããããŠæäœããjQueryãããããšã«æ³šæããŠãã ããã
ãã€ã¢ãã°ããã¯ã¹ã«æ€èšŒãè¿œå ããŸãããã
jsForms.Components.InsertCSSDialog=<br>{ // <br> bOk_Click: function ()<br> {<br> var text = this .C.iStyleClassName.val();<br> if (text==undefined || $.trim(text)== '' )<br> {<br> alert( 'Please enter css class name' );<br> return ;<br> }<br> alert( 'OK, class="' +text+ '");<br> },<br> bCancel_Click:function()<br> {<br> alert(' Cancel');<br> },<br> // <br>}; <br><br> * This source code was highlighted with Source Code Highlighter .
ã³ã³ããŒãã³ãã«ããããã£ãã€ãã³ãããŸãã¯ã³ã³ãããè¿œå ããå Žåã¯ã宣èšããå¿ èŠããããŸãããã®ãããç¹å¥ã«æ§æããããªããžã§ã¯ãããã©ã¡ãŒã¿ãŒãšããŠåãåãjsForms.CreateCompileInfoByObjectïŒobjDeclarationïŒé¢æ°ãåŒã³åºãã®ãæãç°¡åã§ãã
objDeclaration={<br>{Name:<ComponentType>,<br> Properties:{ // Property list <br> <PropertyName1>:{ Type:<PropertyType><,Values:{ object }>, Access:<PropertyAccess>,Description:<String>},<br> <PropertyName2>:{ Type:<PropertyType>,Access:<PropertyAccess>},<br> etc<br> }<br> Events:{<br> <EventName1>:{Description:<String>},<br> <EventName2>:{Description:<String>},<br> <EventName3>:{Description:<String>},<br> etc},<br> Contents:<br> {<br> <ContentName1>:{Description:<String>},<br> <ContentName2>:{Description:<String>},<br> <ContentName3>:{Description:<String>},<br> etc}<br> }<br>}; <br><br> * This source code was highlighted with Source Code Highlighter .
- 説æ-説æããªãã·ã§ã³ã
- ContentName-ã³ã³ããã®ååããã³ãã¬ãŒãã«ã¯ãã³ã³ããã®ãããªå±æ§åãæã€ã¿ã°ãå¿ èŠã§ãã
- PropertyName-ããããã£ã®ååã倧æåãšå°æåã¯åºå¥ãããŸãã
- PropertyType-ããããã£ã®å ¥åããŒã¿å;ãªããžã§ã¯ããéžæãããŠããå Žåãå ¥åå€ã¯evalïŒ...ïŒãä»ããŠå®è¡ãããããããã£ã«æž¡ãããŸã
- PropertyAccess-ã¢ã¯ã»ã¹ãã¢ã¯ã»ã¹ã 'Direct'ã«èšå®ãããŠããå Žåãããããã£ã»ããããã€ãã¹ããŠã_SetPropertyã¡ãœãããä»ããŠã¬ã³ãŒããäœæãããŸããããã§ãªãå Žåã¯ãSet <PropertyName>ã¡ãœãããåŒã³åºãããå€ãæž¡ãããŸããsetterã¡ãœãããå®çŸ©ããå¿ èŠããããŸãã
PropertyType inïŒ 'Boolean'ã 'String'ã 'Object'ã 'Int'ã 'Float'ã 'Values'ã<undefined>ïŒ<undefined>-ããã©ã«ãã§ã
PropertyAccess inïŒ 'Direct'ã 'Set'ã 'Get'ã 'GetSet'ïŒ 'GetSet'-ããã©ã«ãã§ã
ããããã£ãšã€ãã³ãã宣èšããããŒã®äŸãèŠãŠã¿ãŸãããã
jsForms.Components.Button = {<br> Init: function ()<br> {<br> // <br> // Init, <br> // <br> return this .SetEnabled( true );<br> },<br> eventClick : function (e)<br> {<br> if (e.data) { //e.data <br> if (e.data.P.Enabled) {<br> e.data._ExecEvent( 'onClick' );<br> }<br> }<br> },<br> SetEnabled: function (flag)<br> {<br> if ( this .P.Enabled != flag) {<br> this .P.Enabled = flag== true ;<br> this .attr( 'state' , flag ? 'enabled' : 'disabled' );<br> if (flag) {<br> this .unbind( 'click' ).bind( 'click' , this , this .eventClick );<br> }<br> else {<br> this .unbind( 'click' );<br> }<br> }<br> return this ;<br> },<br> GetEnabled: function ()<br> {<br> return this .P.Enabled;<br> },<br> GetText: function ()<br> {<br> return this .P.text;<br> },<br> SetText: function (newText)<br> {<br> if ( this .P.text != newText) {<br> this .P.text = newText;<br> this .C.text[0].innerHTML = newText;<br> }<br> return this ;<br> }<br>};<br> // ----------------------------------------------- <br> // Compilation INFO <br> // ----------------------------------------------- <br>jsForms.CreateCompileInfoByObject(<br>{<br> Name: 'Button' ,<br> Properties: {<br> Enabled: {<br> Type: 'Boolean' ,<br> Access: 'GETSET' <br> },<br> Text: {}<br> },<br> Events: {<br> onClick: {}<br> }<br>});<br> <br> * This source code was highlighted with Source Code Highlighter .
ããŒãžã«ã³ã³ããŒãã³ããæ¿å ¥ãã
ããŒãžäžã®ã³ã³ããŒãã³ãã䜿çšããããã»ã¹ã«ç§»ããŸãããã
ã³ã³ããŒãã³ããäœæããã«ã¯ãjsForms.CreateComponentïŒcompTypeïŒé¢æ°ãåŒã³åºãå¿ èŠããããŸã
var button = jsForms.CreateComponent( 'Button' );<br> // "" , DOM<br/> <br>button.hide().appendTo(...);<br> // DOM , Init() <br/> <br>button.Init().show();<br> // , .<br/> <br> var button = jsForms.CreateComponent( 'Button' ).hide().appendTo(...).Init().show(); <br><br> * This source code was highlighted with Source Code Highlighter .
æ§èœ
ããã©ãŒãã³ã¹ã枬å®ããããã«ã2000åã®åçŽãªãªããžã§ã¯ããäœæãããåãã¹ãã10åç¹°ãè¿ãããŸããã
ãã¹ãç°å¢ïŒ
WinXP Sp2ãFireFox 3.0.4 + FireBugãCPU Intel Pentium Dual E2160 @ 1.80GHzã2Gb Mem
ã°ã©ããããããããã«ãçµæã¯å€åããŸããããã¯ããããã¬ããŒãžã³ã¬ã¯ã¿ãŒãåå ã§ãjsã®é床ãäœäžããããšããããŸãã
詳现ãªçµ±èšïŒ
- jQueryïŒãã³ãã¬ãŒãïŒ
RtïŒ10 RïŒ2000ãTïŒ1440 ms [æå°ïŒ1315ãæ倧ïŒ2333 ms] [æå°ïŒ0.6575 avrïŒ0.7198ãæ倧ïŒ1.1665 ms] delta = 1018 - æåã®DOMæ§ç¯
RtïŒ10 RïŒ2000ãTïŒ340 ms [æå°ïŒ330ãæ倧ïŒ375 ms] [æå°ïŒ0.1650 avrïŒ0.1701ãæ倧ïŒ0.1875 ms] delta = 45 - jsForms
RtïŒ10 RïŒ2000ãTïŒ442 ms [æå°ïŒ434ãæ倧ïŒ457 ms] [æå°ïŒ0.2170 avrïŒ0.2210ãæ倧ïŒ0.2285 ms] delta = 23
ããã§ãã¹ãã§ããŸã ã
远䌞
çŸæç¹ã§ã¯ã次ã®ã³ã³ããŒãã³ããå®è£ ãããŠããŸãã
- ãã¿ã³-倪ãããŒã
- ButtonDivã¯çŽ æŽãããããŒã§ãããéåžžã«è»œéã§ãã
- ãªã¹ãããã¯ã¹
- ããªãŒãã¥ãŒ
- ã¿ãã³ã³ãããŒã«
- ããã°ã¬ã¹ããŒ
- å°ããªããš
ãã®ã¢ãããŒãã®äœæ¥ã®å®äŸã¯ããµã€ãã ã³ã³ããŒãã³ããšãã£ã¿ãŒã§ãã
ãµã€ãå šäœãšãã¯ãããžãŒèªäœã¯GPL3ã§å©çšã§ããŸãã å ¬åŒãµã€ãããããŠã³ããŒãã§ããŸãã
ãã®ãšãã£ã¿ãŒã¯éçºäžãªã®ã§ãææ¡ãšæ¹å€ã«æºè¶³ããŸãã
ãã¹ãæžã¿ã®ãã¯ãããžãŒïŒFF2 +ãIE7ãSafariãChrome
IE6ããæã¡ã®æ¹ã¯ã賌èªãåæ¢ããŠãã ãããäºåã«æè¬ããŸãã
Habrã«ãæè¬ããŸããå€ãã®ã¢ã€ãã¢ã圌ã®ããŒãžããå³åº§ã«åãå ¥ããããããã§ãã
ããããšã