diff --git a/demo/js/base/editor/demo.rich_editor.js b/demo/js/base/editor/demo.rich_editor.js index eef20d09b1..72dbfdbd11 100644 --- a/demo/js/base/editor/demo.rich_editor.js +++ b/demo/js/base/editor/demo.rich_editor.js @@ -3,6 +3,7 @@ Demo.RichEditor = BI.inherit(BI.Widget, { baseCls: "demo-rich-editor" }, render: function () { + var self = this; this.editor = BI.createWidget({ type: "bi.rich_editor", cls: "mvc-border", @@ -14,7 +15,13 @@ Demo.RichEditor = BI.inherit(BI.Widget, { element: this, hgap: 30, vgap: 50, - items: [this.editor] + items: [this.editor, { + type: "bi.button", + text: "focus", + handler: function () { + self.editor.focus(); + } + }] }); }, diff --git a/demo/js/config/widget.js b/demo/js/config/widget.js index cd42165d2e..5b71f6c776 100644 --- a/demo/js/config/widget.js +++ b/demo/js/config/widget.js @@ -222,4 +222,8 @@ Demo.WIDGET_CONFIG = [{ id: 420, text: "滚动sliders", value: "demo.slider" +}, { + id: 422, + text: "过滤Filter", + value: "demo.filter" }]; \ No newline at end of file diff --git a/demo/js/widget/filter/demo.filter.js b/demo/js/widget/filter/demo.filter.js new file mode 100644 index 0000000000..e0b151b89e --- /dev/null +++ b/demo/js/widget/filter/demo.filter.js @@ -0,0 +1,65 @@ +Demo.Filter = BI.inherit(BI.Widget, { + props: {}, + _createFilter: function () { + var filter = BI.createWidget({ + type: "bi.filter", + width: 600, + height: 300, + items: [{ + id: "3beb41be9c67d80d", + value: 81, + children: [{ + id: 1, + type: "bi.label", + value: "节点1" + }, { + id: "74cf470c15a7cb23", + value: 80, + children: [{ + id: 2, + type: "bi.label", + value: "节点2" + }, { + id: 3, + type: "bi.label", + value: "节点3" + }] + }, { + id: 4, + type: "bi.label", + value: "节点4" + }] + }], + itemCreator: function (item) { + if(item.value === BI.Filter.FILTER_TYPE.EMPTY_FORMULA || item.value === BI.Filter.FILTER_TYPE.EMPTY_CONDITION) { + item.type = "bi.label"; + item.value = "这是一个新添的数据"; + } + } + }); + + return filter; + }, + + render: function () { + + var filter = this._createFilter(); + + return { + type: "bi.vertical", + hgap: 30, + vgap: 20, + items: [{ + el: filter + }, { + type: "bi.button", + text: "过滤结构getValue()", + height: 30, + handler: function () { + BI.Msg.alert("过滤结构", JSON.stringify(filter.getValue())); + } + }] + }; + } +}); +BI.shortcut("demo.filter", Demo.Filter); \ No newline at end of file diff --git a/demo/js/widget/singleselct/demo.single_select_combo.js b/demo/js/widget/singleselct/demo.single_select_combo.js index 84d10901bf..8f28cb1454 100644 --- a/demo/js/widget/singleselct/demo.single_select_combo.js +++ b/demo/js/widget/singleselct/demo.single_select_combo.js @@ -14,7 +14,8 @@ Demo.SingleSelectCombo = BI.inherit(BI.Widget, { width: 200, ref: function () { self.SingleSelectCombo = this; - } + }, + value: "柳州市针织总厂" }); widget.on(BI.SingleSelectCombo.EVENT_CONFIRM, function () { diff --git a/demo/version.js b/demo/version.js index d13159199a..4c2d725971 100644 --- a/demo/version.js +++ b/demo/version.js @@ -147,5 +147,13 @@ BI.i18n = { "BI-Basic_Year_Quarter": "年季度", "BI-Basic_Input_Can_Not_Null": "输入框不能为空", "BI-Basic_Input_From_To_Number": "请输入{R1}的数值", - "BI-Basic_Date_Time_Error_Text": "日期格式示例:2015-3-11 00:00:00" + "BI-Basic_Date_Time_Error_Text": "日期格式示例:2015-3-11 00:00:00", + "BI-Basic_Or": "或", + "BI-Basic_And": "且", + "BI-Conf_Add_Formula": "添加公式", + "BI-Conf_Add_Condition": "添加条件", + "BI-Conf_Formula_And": "且公式条件", + "BI-Conf_Formula_Or": "或公式条件", + "BI-Conf_Condition_And": "且条件", + "BI-Conf_Condition_Or": "或条件" }; \ No newline at end of file diff --git a/dist/_fineui.min.js b/dist/_fineui.min.js index 980d7bd4ea..10649e338a 100644 --- a/dist/_fineui.min.js +++ b/dist/_fineui.min.js @@ -34,19 +34,20 @@ var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j} BI.Farbtastic.superclass._init.apply(this,arguments)},mounted:function(){var a=this;this.farbtastic=$.farbtastic(this.element,function(b){a.fireEvent(BI.Farbtastic.EVENT_CHANGE,a.getValue(),a)})},setValue:function(a){this.farbtastic.setColor(a)},getValue:function(){return this.farbtastic.color}}),BI.Farbtastic.EVENT_CHANGE="Farbtastic.EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),jQuery.fn.farbtastic=function(a){return $.farbtastic(this,a),this},jQuery.farbtastic=function(a,b){var a=$(a).get(0);return a.farbtastic||(a.farbtastic=new jQuery._farbtastic(a,b))},jQuery._farbtastic=function(a,b){var c=this;$(a).html('