[Commits] r2394 - in sandbox/camptocamp/geobretagne: lib/GeoExt/plugins tests/lib/GeoExt/plugins
commits at geoext.org
commits at geoext.org
Wed Sep 22 14:30:24 CEST 2010
Author: elemoine
Date: 2010-09-22 14:30:24 +0200 (Wed, 22 Sep 2010)
New Revision: 2394
Modified:
sandbox/camptocamp/geobretagne/lib/GeoExt/plugins/PrintPageField.js
sandbox/camptocamp/geobretagne/tests/lib/GeoExt/plugins/PrintPageField.html
Log:
apply patch-343-A1.diff from #343, which is the patch applied to trunk
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/plugins/PrintPageField.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/plugins/PrintPageField.js 2010-09-22 12:27:08 UTC (rev 2393)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/plugins/PrintPageField.js 2010-09-22 12:30:24 UTC (rev 2394)
@@ -100,8 +100,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: sandbox/camptocamp/geobretagne/tests/lib/GeoExt/plugins/PrintPageField.html
===================================================================
--- sandbox/camptocamp/geobretagne/tests/lib/GeoExt/plugins/PrintPageField.html 2010-09-22 12:27:08 UTC (rev 2393)
+++ sandbox/camptocamp/geobretagne/tests/lib/GeoExt/plugins/PrintPageField.html 2010-09-22 12:30:24 UTC (rev 2394)
@@ -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