⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dynamicform.js

📁 javascript 很酷的类库
💻 JS
📖 第 1 页 / 共 5 页
字号:
    // means that if any single column overflows (due to, eg, a long unbreakable title),    // the form as a whole overflows.    // <P>	// If false, columns will have their specified sizes as long as no column overflows.  If    // any column overflows, space will be taken from any other columns that aren't filling the    // available room, until there is no more free space, in which case the form as a whole    // overflows.    // 	// @group tableLayout    // @visibility external	//<    	fixedColWidths:false,        // fixedRowHeights - undocumented property that causes heights to be written into cells,     // which, like fixedColumnWidths, puts you into a situation where you're more likely to     // overflow.     fixedRowHeights:false,    //>	@attr	dynamicForm.colWidths		(Array : null : [IRW])    // An array of widths for the columns of items in this form's layout grid.     // <P>    // If specified, these widths should sum to the total width of the form (form.width).    // If not specified, we assume every other column will contain form item titles, and so    // should have <code>form.titleWidth</code>, and all other columns should share the    // remaining space.    // <P>    // Acceptable values for each element in the array are:<br>    // <ul>    // <li>A number (e.g. 100) representing the number of pixel widths to allocate to a    //     column.    // <li>A percent (e.g. 20%) representing the percentage of the total form.width to    //     allocate to a column.    // <li>"*" (all) to allocate remaining width (form.width minus all specified column    //     widths). Multiple columns can use "*", in which case remaining width is divided    //     between all columns marked "*".    // </ul>    // @group tableLayout    // @visibility external    // @example columnSpanning    //<	colWidths:null,        //>	@attr	dynamicForm.minColWidth		(number : 20 : IRW)	// Minimum width of a form column.	// @group tableLayout    // @visibility external	//<	minColWidth:20,    //>	@attr	dynamicForm.cellSpacing		(number : 0 : [IRW])    // The amount of empty space, in pixels, between form item cells in the layout grid.    // @group tableLayout    // @visibility internal    //<    	cellSpacing:0,        //>	@attr	dynamicForm.cellPadding		(number : 2 : [IRW])    // The amount of empty space, in pixels, surrounding each form item within its cell in    // the layout grid.    // @group tableLayout    // @visibility external    //<	cellPadding:2,        //>	@attr	dynamicForm.cellBorder		(number : 0 : [IRW])    // Width of border for the table that form is drawn in. This is primarily used for debugging    // form layout.    // @group tableLayout    // @visibility external    //<	cellBorder:0,    // default height for a table row where there are no specified sizes at all (pixel, '*', or    // percent)    defaultRowHeight:22,    //> @attr DynamicForm.sectionVisibilityMode (VisibilityMode : "multiple" : [IRW])    // If the form has sections, [implemented as +link{SectionItem}s], this attribute controls    // whether multiple sections can be expanded at once.    //    // @see type:VisibilityMode    // @see class:SectionItem    // @group tableLayout    // @visibility external    //<    sectionVisibilityMode: "multiple",    // Embedded widgets    // --------------------------------------------------------------------------------------------    // Turn on allowContentAndChildren for Canvas Items.    // NOTE: this has no actual effect unless a CanvasItem is used        allowContentAndChildren : true,    separateContentInsertion: true,    _avoidRedrawFlash:true,    // necessary because the default determination assumes anything with children doesn't have    // inherent height    hasInherentHeight : function () {        if (this.inherentHeight != null) return this.inherentHeight;        return (this.overflow == isc.Canvas.VISIBLE || this.overflow == isc.Canvas.CLIP_H);    },    // DataBinding	// --------------------------------------------------------------------------------------------    //>	@attr	dynamicForm.fieldIdProperty		(string : "name" : IRWA)	// Name of the column in the fields array that holds the name of the item property that holds    // the value	//		@group	data	//<	fieldIdProperty:"name",		    //>	@attr	dynamicForm.titleField		(string : "title" : IRWA)	// Name of the column in the fields array that holds the name of the title property that holds    // the title	//		@group	appearance	//<	titleField:"title",    //>	@attr	dynamicForm.showDetailFields (boolean : true : IR)	// For databound forms, whether to show fields marked as detail fields.	//<    showDetailFields: true,    //>	@attr dynamicForm.longTextEditorThreshold (number : 255 : IRW)	// When creating form items for fields with text type data, if the specified length of the    // field exceeds this threshold we will create form item of type     // <code>this.longTextEditorType</code> (a TextAreaItem by default), rather than a simple    // text item.  Overridden by explicitly specifying <code>editorType</code> for the field. 	// @group appearance    // @visibility external    	//<	longTextEditorThreshold:255,    //>	@attr dynamicForm.longTextEditorType (string  : "textArea" : IRW)	// Name of the Form Item class to use for text fields which exceed the     // longTextEditorThreshold for this form. 	// @group appearance    // @visibility external	//<    longTextEditorType:"textArea",        //>ValuesManager        // ValuesManager    // ----------------------------------------------------------------------------------------    //>@attr dynamicForm.valuesManager  (ValuesManager instance or global ID : null : [IA])    // If set at init time, this dynamicForm will be created as a member form for the    // specified valuesManager.  To update the valuesManager to which a form belongs after init    // use <code>valuesManager.addMember(form)</code> and     // <code>valuesManager.removeMember(form)</code>    // @see class:ValuesManager    // @visibility external    // @group formValuesManager    //<    //<ValuesManager        // Title Formatting	// --------------------------------------------------------------------------------------------    //> @type  TitleOrientation    // Orientation of titles relative to the FormItem being labelled.  Can be set a the    // DynamicForm level as a default, or on individual items.    //     // @value  "left"    // @value  "top"    // @value  "right"    // @group formTitles    // @see DynamicForm.titleOrientation    // @see FormItem.titleOrientation    // @visibility external    //<    //>	@attr	dynamicForm.titleOrientation    (TitleOrientation : "left" : [IRW])    // Default orientation for titles for items in this form.  +link{type:TitleOrientation}    // lists valid options.    // <P>    // Note that titles on the left or right take up a cell in tabular    // +link{group:formLayout,form layouts}, but titles on top do not.    //     //      @group  formTitles    //      @visibility external    // @example formLayoutTitles    //<        //>	@attr	dynamicForm.titlePrefix		(string : "" : [IRW])    //          The string prepended to the title of every item in this form.    //      @group  formTitles    //      @visibility external    //<	titlePrefix:"",        //>	@attr	dynamicForm.rightTitlePrefix (string : ":&nbsp;" : [IRW])    //          The string prepended to the title of an item in this form if its    //          titleOrientation property is set to "right".    //      @group  formTitles    //      @visibility external    //<	rightTitlePrefix:":&nbsp;",    //>	@attr	dynamicForm.titleSuffix		(string : "&nbsp;:" : [IRW])    //          The string appended to the title of every item in this form.    //      @group  formTitles    //      @visibility external    //<	titleSuffix:"&nbsp;:",        //>	@attr	dynamicForm.rightTitleSuffix (string : "" : [IRW])    //          The string appended to the title of an item in this form if its titleOrientation    //          property is set to "right".    //      @group  formTitles    //      @visibility external    //<	rightTitleSuffix:"",    //>	@attr	dynamicForm.titleWidth		(number or "*": 100 : [IRW])    //          The width in pixels allocated to the title of every item in this form.  If you    //          don't specify explicit +link{attr:dynamicForm.colWidths}, you can set this    //          value to the string "*" to divide the usable space evenly between titles and    //          fields.    //      @group  formTitles    //      @visibility external    //<	titleWidth:100,        //>	@attr	dynamicForm.clipItemTitles (boolean : false : [IRW])    // Should the titles for form items be clipped if they are too large for the available     // space?<br>    // Can be overridden for individual items via <code>formItem.clipTitle</code>    //<//    clipItemTitles:false,    //>	@attr	dynamicForm.wrapItemTitles (boolean : null : [IRW])    // Whether titles for form items should wrap.  If not specified, titles will wrap by    // default.  Can be overridden for individual items via +link{formItem.wrapTitle}    // @visibility external    // @group formTitles        //<    // NOTE: actual default is based on df.clipItemTitles, but that isn't documented.//    wrapItemTitles:null,    //> @attr   dynamicForm.showInlineErrors (boolean : true : [IRW])    // Should field errors be written into the form next to the appropriate form items?      // @group validation    // @visibility external    //<    showInlineErrors: true,        // customization of inline errors appearance on items    //    //> @attr dynamicForm.showErrorIcons (boolean : true : IRW)    // +link{dynamicForm.showErrorIcons,showErrorIcons},     // +link{dynamicForm.showErrorText,showErrorText}, and    // +link{dynamicForm.showErrorStyle,showErrorStyle} control how validation errors are    // displayed next to form items when +link{dynamicForm.showInlineErrors} is true.    // These properties can be set on a DynamicForm to control the behavior form-wide, or set    // on individual FormItems.    // <P>    // The combination of +link{showErrorText}:false and +link{errorOrientation}:"left" creates    // a compact validation error display consisting of just an icon, with the error message    // available via a hover.  This avoids the form     //    // @group  validation    // @visibility external    //<        showErrorIcons: true,        //> @attr dynamicForm.showErrorText (boolean : true : IRW)    // @include dynamicForm.showErrorIcons    // @group  validation    // @visibility external    //<     showErrorText: true,        //> @attr dynamicForm.showErrorStyle (boolean : true : IRW)    // @include dynamicForm.showErrorIcons    // @group  validation    // @visibility external    //<        showErrorStyle: true,        //> @attr dynamicForm.errorOrientation (align : null : IRW)    // If +link{dynamicForm.showInlineErrors} is true, where should the error icon and text appear    // relative to form items?  Valid options are <code>"top"</code>,     // <code>"bottom"</code>, <code>"left"</code> or <code>"right"</code>.<br>    // May be overridden at the item level via +link{formItem.errorOrientation}.    // @group validation, appearance    // @visibility external    //<    errorOrientation: "top",        // Enable customization of the error item    errorItemDefaults : {        type:"blurb",        wrap:true,        showIf:function () {            return !this.form.showInlineErrors && this.form.hasErrors();         },        defaultDynamicValue : function (item,form,values) {            return form.getErrorsHTML(form.getErrors());        }    },    //> @attr dynamicForm.errorItemProperties (object : null : [IRA])    // If +link{dynamicForm.showInlineErrors} is false we show all errors for the form item in     // a single item rendered at the top of the form.<br>    // This attribute contains a properties block for this item.    // @group validation    // @visibility external    //<    //errorItemProperties : {},        //> @attr dynamicForm.errorItemCellStyle (string  : "formCellError" : [IR])    // If +link{dynamicForm.showInlineErrors} is false we show all errors for the form item in     // a single item rendered at the top of the form.<br>    // This attribute specifies the cellStyle to apply to this item.    // @group validation    // @visibility external    //<    errorItemCellStyle:"formCellError",        //> @attr dynamicForm.errorsPreamble (string :"The following errors were found" : [IR])    // If +link{dynamicForm.showInlineErrors} is false we show all errors for the form item in     // a single item rendered at the top of the form.<br>    // This attribute specifies an introductory string rendered out before the individual error    // messages.    // @group validation, i18nMessages    // @visibility external    //<

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -