[Commits] r2391 - in core/trunk/geoext: lib/GeoExt/plugins tests/lib/GeoExt/plugins
commits at geoext.org
commits at geoext.org
Wed Sep 22 12:19:47 CEST 2010
Author: elemoine
Date: 2010-09-22 12:19:47 +0200 (Wed, 22 Sep 2010)
New Revision: 2391
Modified:
core/trunk/geoext/lib/GeoExt/plugins/PrintPageField.js
core/trunk/geoext/tests/lib/GeoExt/plugins/PrintPageField.html
Log:
PrintPageField - add support for Checkbox, r=fredj, p=bbinet,me (closes #343)
Modified: core/trunk/geoext/lib/GeoExt/plugins/PrintPageField.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/plugins/PrintPageField.js 2010-09-22 09:00:21 UTC (rev 2390)
+++ core/trunk/geoext/lib/GeoExt/plugins/PrintPageField.js 2010-09-22 10:19:47 UTC (rev 2391)
@@ -102,8 +102,10 @@
init: function(target) {
this.target = target;
var onCfg = {scope: this};
- onCfg[target instanceof Ext.form.ComboBox ? "select" : "valid"] =
- this.onFieldChange;
+ var eventName = target instanceof Ext.form.ComboBox ?
+ "select" : target instanceof Ext.form.Checkbox ?
+ "check" : "valid";
+ onCfg[eventName] = this.onFieldChange;
target.on(onCfg);
this.printPage.on({
"change": this.onPageChange,
Modified: core/trunk/geoext/tests/lib/GeoExt/plugins/PrintPageField.html
===================================================================
--- core/trunk/geoext/tests/lib/GeoExt/plugins/PrintPageField.html 2010-09-22 09:00:21 UTC (rev 2390)
+++ core/trunk/geoext/tests/lib/GeoExt/plugins/PrintPageField.html 2010-09-22 10:19:47 UTC (rev 2391)
@@ -170,6 +170,30 @@
t.eq(log.setValue, undefined, "setValue not called while updating.");
}
+ function test_Checkbox(t) {
+ t.plan(1);
+
+ var printPage = new GeoExt.data.PrintPage({
+ printProvider: new GeoExt.data.PrintProvider({
+ capabilities: printCapabilities
+ })
+ });
+
+ var plugin = new GeoExt.plugins.PrintPageField({
+ printPage: printPage
+ });
+
+ var field = new Ext.form.Checkbox({
+ name: "foo",
+ checked: true,
+ plugins: [plugin]
+ });
+
+ field.setValue(false);
+ t.eq(printPage.customParams.foo, false,
+ "setValue(false) called, custom param is false");
+ }
+
</script>
</head>
<body>
More information about the Commits
mailing list