- Timestamp:
- 2011-03-15 08:53:20 (14 months ago)
- Location:
- trunk/modules/kauri-forms/kauri-forms-framework/src
- Files:
-
- 3 edited
-
main/kauri/static-{build}.key/kauri.forms/case.js (modified) (1 diff)
-
main/kauri/static-{build}.key/kauri.forms/control.js (modified) (3 diffs)
-
test/kauri.forms/test-form.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/static-{build}.key/kauri.forms/case.js
r1863 r1873 197 197 } 198 198 199 /** 200 * Gets all child controls 201 * @return object containing all the children 202 * @param includeAll boolean indicating if the 'hidden' children of this container should be included (see case-control) 203 * @type Object 204 */ 205 CaseControl.prototype.getChildren = function(includeAll) { 206 includeAll = includeAll || false; 207 if (includeAll) 208 return this._valueControls; 209 return 210 this["<super.call>"]("getChildren"); 211 212 } 199 213 200 214 /** -
trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/static-{build}.key/kauri.forms/control.js
r1869 r1873 2108 2108 * Loops through all children and exectues the passed function in turn with each name/index and child as argument 2109 2109 * @param fn(index, child) callback function for each child 2110 */ 2111 AbstractContainerControl.prototype.eachChild = function(fn, stopable) { 2110 * @param stopable boolean specifiying if the first false return will stop processing to other children 2111 * @param includeAll boolean indicating if the 'hidden' children of this container should be included (see case-control) 2112 */ 2113 AbstractContainerControl.prototype.eachChild = function(fn, stopable, includeAll) { 2112 2114 stopable = stopable || false; 2115 includeAll = includeAll || false; 2113 2116 if (!$.isFunction(fn)) { 2114 2117 return; 2115 2118 } 2116 2119 //else 2117 var children = this.getChildren( );2120 var children = this.getChildren(includeAll); 2118 2121 if (!stopable) { 2119 2122 for (var i in children) { … … 2375 2378 * Gets all child controls 2376 2379 * @return object containing all the children 2380 * @param includeAll boolean indicating if the 'hidden' children of this container should be included (see case-control) 2377 2381 * @type Object 2378 2382 */ … … 2663 2667 if (child.delegates) 2664 2668 child.delegate.apply(child, args); 2665 } );2669 }, false, true); 2666 2670 } 2667 2671 -
trunk/modules/kauri-forms/kauri-forms-framework/src/test/kauri.forms/test-form.js
r1863 r1873 727 727 }); 728 728 729 730 test("delegation of case-control issue #449", function() { 731 732 // create 733 var $main = $('#main').show(); 734 735 var delegatesExecuted = []; 736 737 var $form = $('<form></form>').appendTo($main); 738 var fconf = { 739 740 members : { 741 'c' : { 742 base: 'case', 743 "+validators": { "required": {} }, 744 "control": { 745 "base": "case-control", 746 "nullable": false, 747 "initial":{"value": {"case":"t"}} 748 }, 749 "cases": { 750 "t" : { 751 "base": "string", 752 control: 'my-test-control' 753 }, 754 "n" : { 755 "base": "string", 756 control: 'my-test-control' 757 } 758 } 759 } 760 }, 761 762 controlTypes : { 763 'my-test-control' : { 764 base :'input-control', 765 delegates: true, 766 testDelegate: function(x) { 767 delegatesExecuted[delegatesExecuted.length] = this.getId(); 768 }, 769 initial: {value: "s"} 770 } 771 } 772 }; 773 774 var form = new $.org.kauriproject.forms.Form($form, fconf); 775 776 expect(2); 777 778 form.delegate("testDelegate", "x"); 779 780 ok($.inArray("case-t", delegatesExecuted) > -1, "checking delegation ran for active case."); 781 ok($.inArray("case-n", delegatesExecuted) > -1, "checking delegation ran for non-active case."); 782 783 // cleanup 784 $main.html("").hide(); 785 786 }); 787 788 729 789 test("inital valid-state of various container controls", function() { 730 790
Note: See TracChangeset
for help on using the changeset viewer.