{"isTemplate":false,"layout":[{"displayLabel":"Dynamic Grid Example","showEditPanel":false,"ui":{"textColor":"#000","backgroundColor":"#757575"},"show":true,"open":true,"expandOnLoad":true,"class":"","id":"1525700857287s","ClientID":"secDynamicGridExample","type":"Section_Type","readonly":false,"contents":[{"showEditPanel":false,"ClientID":"1525700857287c","id":"1525700857287c","type":"Container_Type","show":true,"open":true,"readonly":false,"columns":[{"items":[{"displayName":"Button","Label":"Clear Grid","QuestionType":"Button","ClientID":"btnClear","class":"","type":"FormTool_Type","show":true,"events":{"onClick":null},"new":true,"loaded":true,"isdirty":false,"id":1559671349314,"islive":false,"showEditPanel":false,"stopBlurSave":false,"validation":{}},{"showLabel":false,"stopBlurSave":false,"buttons":{"show":true,"delete":{"show":true,"disabled":true},"add":{"show":true,"disabled":false}},"cellTemplates":{"date":"\n {{row.entity[col.field] | intDate:false}}\n "},"islive":false,"originalAnswer":null,"isdirty":false,"loaded":true,"events":{"onFocus":null,"onBlur":null,"onChange":null},"showEditPanel":false,"id":1525700874295,"new":false,"gridOptions":{"keyDownOverrides":[],"modifierKeysToMultiSelectCells":false,"cellEditableCondition":true,"appScopeProvider":null,"gridMenuTemplate":"ui-grid/uiGridMenu","rowTemplate":"ui-grid/ui-grid-row","gridFooterTemplate":"ui-grid/ui-grid-grid-footer","footerTemplate":"ui-grid/ui-grid-footer","headerTemplate":null,"minimumColumnSize":10,"enableMinHeightCheck":true,"enableHorizontalScrollbar":1,"enableVerticalScrollbar":1,"enableColumnMenus":true,"scrollDebounce":300,"wheelScrollThrottle":70,"aggregationCalcThrottle":500,"horizontalScrollThreshold":2,"excessColumns":4,"scrollThreshold":4,"excessRows":4,"columnVirtualizationThreshold":10,"virtualizationThreshold":20,"maxVisibleColumnCount":200,"columnWidth":50,"gridFooterHeight":30,"columnFooterHeight":30,"showGridFooter":false,"rowHeight":30,"headerRowHeight":30,"showHeader":true,"flatEntityAccess":false,"enableRowHashing":true,"excludeProperties":["$$hashKey"],"allowUsersToDeleteRows":true,"showColumnFooter":true,"showAddRowButton":true,"data":[],"columnDefs":[{"name":"Transaction Date","width":"150","type":"date","enableCellEdit":true,"id":"gridcol-1525702215636","cellTemplate":"\n {{row.entity[col.field] | intDate:false}}\n ","selectedCurrencyFilter":null,"footerCellFilter":null,"validators":{"required":true},"allowCellFocus":true,"enableCellEditOnFocus":true,"enableSorting":false,"delete":false,"aggregationColumns":null,"rowAggregationType":null,"cellEditableCondition":true,"editableCellTemplate":"ui-grid/cellEditor","displayName":"Transaction Date"},{"name":"Expense Type","width":"200","type":"MultiChoiceSelectList","enableCellEdit":true,"id":"gridcol-1525702331870","cellTemplate":"","selectedCurrencyFilter":null,"footerCellFilter":null,"question":{"disabled":false,"SelectedValue":null,"Answer":null,"dbSettings":{"useDB":false},"show":true,"class":"gridSelectList","ClientID":"","flex":100,"multiple":false,"Choices":[{"Value":"Airline Tickets","Label":"Airline Tickets","showEditPanel":false},{"Label":"Taxis / Rental Cars","Value":"Taxis / Rental Cars","showEditPanel":false},{"Label":"Hotels","Value":"Hotels","showEditPanel":false},{"showEditPanel":false,"Value":"Meals","Label":"Meals"},{"showEditPanel":false,"Value":"Parking","Label":"Parking"}],"Label":"Expense Type","QuestionType":"MultiChoiceSelectList"},"validators":{"required":true},"allowCellFocus":false,"enableCellEditOnFocus":false,"enableSorting":false,"delete":false,"aggregationColumns":null,"rowAggregationType":null,"editableCellTemplate":"","cellEditableCondition":true,"displayName":"Expense Type"},{"name":"Amount","width":"150","type":"currency","enableCellEdit":true,"id":"gridcol-1525702495956","customCellClass":"","headerCellClass":"","cellTemplate":" {{grid.getCellValue(row, col) | intCurrency:\"en-us\"}}","selectedCurrencyFilter":"en-us","footerCellFilter":"intCurrency:\"en-us\"","aggregationType":2,"validators":{"required":true},"allowCellFocus":true,"enableCellEditOnFocus":true,"delete":false,"cellEditableCondition":true,"editableCellTemplate":"ui-grid/cellEditor","displayName":"Amount","aggregationLabel":" "},{"name":"Receipt","width":"300","type":"FileAttachment","enableCellEdit":true,"id":"gridcol-1525713904967","cellTemplate":"","selectedCurrencyFilter":null,"footerCellFilter":null,"question":{"QuestionType":"FileAttachment","Label":"File Attachment: ","flex":100,"ClientID":"","class":"gridFileAttachment","show":true,"Answer":[],"events":{"onChange":null}},"validators":{"required":false},"allowCellFocus":false,"enableCellEditOnFocus":false,"delete":false,"editableCellTemplate":"","cellEditableCondition":true,"displayName":"Receipt"},{"name":"On Company AMX","width":"170","type":"boolean","enableCellEdit":true,"id":"gridcol-1525702282531","selectedCurrencyFilter":null,"footerCellFilter":null,"validators":{"required":false},"allowCellFocus":true,"enableCellEditOnFocus":true,"enableSorting":false,"delete":false,"aggregationColumns":null,"rowAggregationType":null,"cellEditableCondition":true,"editableCellTemplate":"ui-grid/cellEditor","displayName":"On Company AMX"},{"name":"Employees Covered","width":"170","type":"number","enableCellEdit":true,"id":"gridcol-1525702299087","cellClass":"currency","selectedCurrencyFilter":null,"footerCellFilter":null,"aggregationType":null,"validators":{"required":false},"allowCellFocus":true,"enableCellEditOnFocus":true,"enableSorting":false,"delete":false,"aggregationColumns":null,"rowAggregationType":null,"cellEditableCondition":true,"editableCellTemplate":"ui-grid/cellEditor","displayName":"Employees Covered"}],"maxHeight":350,"rowsSpecified":0,"minRowsToShow":"4","enableSorting":true,"enableFiltering":false,"enableCellEditOnFocus":false,"enableCellEdit":true,"filterContainer":"headerCell","menuButtonTemplate":"ui-grid/ui-grid-menu-button","menuItemTemplate":"ui-grid/uiGridMenuItem"},"Answer":null,"show":true,"class":"","ClientID":"grdDynamicGrid","flex":100,"type":"Question_Type","Label":"Dynamic Grid","QuestionType":"Grid","displayName":"Grid","validation":{}},{"hidden":false,"stopBlurSave":false,"islive":false,"originalAnswer":null,"isdirty":false,"loaded":true,"showEditPanel":false,"id":1525789250935,"new":false,"Answer":null,"format":{"currency":{"id":"en-us","useCurrency":true},"digitsAfterDecimal":2},"events":{"onFocus":null,"onBlur":null,"onChange":null},"validation":{"regExMessage":"This field is not valid","regEx":null,"maxMessage":"This field is too long","max":null,"minMessage":"This field is too short","min":null,"requiredMessage":"This field is required","required":false},"show":true,"class":"","ClientID":"numHiddenTotalExpenses","flex":100,"type":"Question_Type","Label":"Hidden_Total_Expenses (for start rules, notifications, reports)","QuestionType":"Number","displayName":"Number"},{"stopBlurSave":false,"showEditPanel":false,"islive":false,"ClientID":1525724771946,"id":1525724771946,"isdirty":false,"loaded":true,"events":{"onFocus":null,"onBlur":null,"onChange":null},"new":true,"show":true,"type":"FormTool_Type","formtext":"
\n

Subtotals by Expense Category

\n
","QuestionType":"FormText","displayName":"Form Text","validation":{}}]}],"icon":"crop_square","displayName":"Container"},{"showEditPanel":false,"new":true,"ClientID":"1525724421511c","id":"1525724421511c","type":"Container_Type","show":true,"open":true,"readonly":false,"columns":[{"items":[{"readonly":true,"stopBlurSave":false,"islive":false,"originalAnswer":null,"isdirty":false,"loaded":true,"showEditPanel":false,"id":1525724444553,"new":false,"Answer":null,"format":{"currency":{"id":"en-us","useCurrency":true},"digitsAfterDecimal":2},"events":{"onFocus":null,"onBlur":null,"onChange":null},"validation":{"regExMessage":"This field is not valid","regEx":null,"maxMessage":"This field is too long","max":null,"minMessage":"This field is too short","min":null,"requiredMessage":"This field is required","required":false},"show":true,"class":"","ClientID":"numAirlineTickets","flex":100,"type":"Question_Type","Label":"Airline Tickets","QuestionType":"Number","displayName":"Number"},{"displayName":"Button","Label":"Hide / Show Buttons","QuestionType":"Button","ClientID":"btnHideShowButtons","class":"","type":"FormTool_Type","show":true,"events":{"onClick":null},"new":true,"loaded":true,"isdirty":false,"id":1525810052826,"islive":false,"showEditPanel":false,"stopBlurSave":false,"validation":{}}]},{"items":[{"readonly":true,"stopBlurSave":true,"islive":false,"originalAnswer":null,"isdirty":false,"loaded":true,"showEditPanel":false,"id":1525724568168,"new":false,"Answer":null,"format":{"currency":{"id":"en-us","useCurrency":true},"digitsAfterDecimal":2},"events":{"onFocus":null,"onBlur":null,"onChange":null},"validation":{"regExMessage":"This field is not valid","regEx":null,"maxMessage":"This field is too long","max":null,"minMessage":"This field is too short","min":null,"requiredMessage":"This field is required","required":false},"show":true,"class":"","ClientID":"numTaxisRentalCars","flex":100,"type":"Question_Type","Label":"Taxis / Rental Cars","QuestionType":"Number","displayName":"Number"},{"stopBlurSave":false,"showEditPanel":false,"islive":false,"id":1525810896088,"isdirty":false,"loaded":true,"new":true,"events":{"onClick":null},"show":true,"type":"FormTool_Type","class":"","ClientID":"btnHideShowFooter","QuestionType":"Button","Label":"Hide / Show Footer","displayName":"Button","validation":{}}]},{"items":[{"readonly":true,"stopBlurSave":false,"islive":false,"originalAnswer":null,"isdirty":false,"loaded":true,"showEditPanel":false,"id":1525724618514,"new":false,"Answer":null,"format":{"currency":{"id":"en-us","useCurrency":true},"digitsAfterDecimal":2},"events":{"onFocus":null,"onBlur":null,"onChange":null},"validation":{"regExMessage":"This field is not valid","regEx":null,"maxMessage":"This field is too long","max":null,"minMessage":"This field is too short","min":null,"requiredMessage":"This field is required","required":false},"show":true,"class":"","ClientID":"numHotels","flex":100,"type":"Question_Type","Label":"Hotels","QuestionType":"Number","displayName":"Number"},{"displayName":"Button","Label":"Process Check Rows","QuestionType":"Button","ClientID":"btnProcessCheckedRows","class":"","type":"FormTool_Type","show":true,"events":{"onClick":null},"new":true,"loaded":true,"isdirty":false,"id":1525890911326,"islive":false,"showEditPanel":false,"stopBlurSave":false,"validation":{}}]},{"items":[{"hidden":false,"readonly":true,"stopBlurSave":false,"islive":false,"originalAnswer":null,"isdirty":false,"loaded":true,"showEditPanel":false,"id":1525724642224,"new":false,"Answer":null,"format":{"currency":{"id":"en-us","useCurrency":true},"digitsAfterDecimal":2},"events":{"onFocus":null,"onBlur":null,"onChange":null},"validation":{"regExMessage":"This field is not valid","regEx":null,"maxMessage":"This field is too long","max":null,"minMessage":"This field is too short","min":null,"requiredMessage":"This field is required","required":false},"show":true,"class":"","ClientID":"numMeals","flex":100,"type":"Question_Type","Label":"Meals","QuestionType":"Number","displayName":"Number"},{"stopBlurSave":false,"showEditPanel":false,"islive":false,"id":1526323895878,"isdirty":false,"loaded":true,"new":true,"events":{"onClick":null},"show":true,"type":"FormTool_Type","class":"","ClientID":"btnPreventAllowDelete","QuestionType":"Button","Label":"Prevent / Allow Delete","displayName":"Button","validation":{}}]},{"items":[{"readonly":true,"stopBlurSave":false,"islive":false,"originalAnswer":null,"isdirty":false,"loaded":true,"showEditPanel":false,"id":1525724695372,"new":false,"Answer":null,"format":{"currency":{"id":"en-us","useCurrency":true},"digitsAfterDecimal":2},"events":{"onFocus":null,"onBlur":null,"onChange":null},"validation":{"regExMessage":"This field is not valid","regEx":null,"maxMessage":"This field is too long","max":null,"minMessage":"This field is too short","min":null,"requiredMessage":"This field is required","required":false},"show":true,"class":"","ClientID":"numParking","flex":100,"type":"Question_Type","Label":"Parking","QuestionType":"Number","displayName":"Number"},{"stopBlurSave":false,"showEditPanel":false,"islive":false,"id":1526406064234,"isdirty":false,"loaded":true,"new":true,"events":{"onClick":null},"show":true,"type":"FormTool_Type","class":"","ClientID":"btnAlignAmountRightLeft","QuestionType":"Button","Label":"Align Amount Right / Left","displayName":"Button","validation":{}}]}],"displayName":"Container"}],"showSectionOutline":true,"showAsCollapsible":true,"icon":"crop_square","Label":"Dynamic Grid Example","displayName":"Section"},{"displayLabel":"Fixed Grid Example","showEditPanel":false,"new":true,"ui":{"textColor":"#000","backgroundColor":"#757575"},"show":true,"open":true,"expandOnLoad":true,"class":"","id":"1525711100988s","ClientID":"secFixedGridExample","type":"Section_Type","readonly":false,"contents":[{"showEditPanel":false,"new":true,"ClientID":"1525711100988c","id":"1525711100988c","type":"Container_Type","show":true,"open":true,"readonly":false,"columns":[{"items":[{"prefillValues":[{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":0,"Text_Editable":"Airline Tickets","Static_Text":"Airline Tickets","Text_Not_Editible":"Airline Tickets","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Airline Tickets","Text Editable":"Airline Tickets","Text Not Editible":"Airline Tickets"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":1,"Text_Editable":"Taxis / Rental Cars","Static_Text":"Taxis / Rental Cars","Text_Not_Editible":"Taxis / Rental Cars","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Taxis / Rental Cars","Text Editable":"Taxis / Rental Cars","Text Not Editible":"Taxis / Rental Cars"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":2,"Text_Editable":"Hotels","Static_Text":"Hotels","Text_Not_Editible":"Hotels","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Hotels","Text Editable":"Hotels","Text Not Editible":"Hotels"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":3,"Text_Editable":"Meals","Static_Text":"Meals","Text_Not_Editible":"Meals","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Meals","Text Editable":"Meals","Text Not Editible":"Meals"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":4,"Text_Editable":"Parking","Static_Text":"Parking","Text_Not_Editible":"Parking","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Parking","Text Editable":"Parking","Text Not Editible":"Parking"}],"stopBlurSave":false,"displayName":"Grid","QuestionType":"Grid","Label":"Grid: ","type":"Question_Type","flex":100,"ClientID":"grdFixedGrid","class":"","show":true,"Answer":[{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":0,"Text_Editable":"Airline Tickets","Static_Text":"Airline Tickets","Text_Not_Editible":"Airline Tickets","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Airline Tickets","Text Editable":"Airline Tickets","Text Not Editible":"Airline Tickets"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":1,"Text_Editable":"Taxis / Rental Cars","Static_Text":"Taxis / Rental Cars","Text_Not_Editible":"Taxis / Rental Cars","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Taxis / Rental Cars","Text Editable":"Taxis / Rental Cars","Text Not Editible":"Taxis / Rental Cars"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":2,"Text_Editable":"Hotels","Static_Text":"Hotels","Text_Not_Editible":"Hotels","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Hotels","Text Editable":"Hotels","Text Not Editible":"Hotels"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":3,"Text_Editable":"Meals","Static_Text":"Meals","Text_Not_Editible":"Meals","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Meals","Text Editable":"Meals","Text Not Editible":"Meals"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":4,"Text_Editable":"Parking","Static_Text":"Parking","Text_Not_Editible":"Parking","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Parking","Text Editable":"Parking","Text Not Editible":"Parking"}],"gridOptions":{"keyDownOverrides":[],"modifierKeysToMultiSelectCells":false,"cellEditableCondition":true,"appScopeProvider":null,"gridMenuTemplate":"ui-grid/uiGridMenu","rowTemplate":"ui-grid/ui-grid-row","gridFooterTemplate":"ui-grid/ui-grid-grid-footer","footerTemplate":"ui-grid/ui-grid-footer","headerTemplate":null,"minimumColumnSize":10,"enableMinHeightCheck":true,"enableHorizontalScrollbar":1,"enableVerticalScrollbar":1,"enableColumnMenus":true,"scrollDebounce":300,"wheelScrollThrottle":70,"aggregationCalcThrottle":500,"horizontalScrollThreshold":2,"excessColumns":4,"scrollThreshold":4,"excessRows":4,"columnVirtualizationThreshold":10,"virtualizationThreshold":20,"maxVisibleColumnCount":200,"columnWidth":50,"gridFooterHeight":30,"columnFooterHeight":30,"showGridFooter":false,"rowHeight":30,"headerRowHeight":30,"showHeader":true,"flatEntityAccess":false,"enableRowHashing":true,"excludeProperties":["$$hashKey"],"allowUsersToDeleteRows":false,"enableCellEdit":true,"enableCellEditOnFocus":false,"enableFiltering":false,"enableSorting":true,"minRowsToShow":"6","rowsSpecified":5,"maxHeight":350,"columnDefs":[{"name":"Static Text","width":"200","type":"StaticText","enableCellEdit":true,"id":"gridcol-1525713044250","selectedCurrencyFilter":null,"footerCellFilter":null,"validators":{"required":false},"allowCellFocus":true,"enableCellEditOnFocus":true,"enableSorting":true,"delete":false,"aggregationColumns":null,"rowAggregationType":null,"cellTooltip":true,"cellEditableCondition":true,"displayName":"Static Text","editableCellTemplate":"ui-grid/cellEditor"},{"name":"Text Not Editible","width":"200","type":"string","enableCellEdit":false,"id":"gridcol-1525713143760","selectedCurrencyFilter":null,"footerCellFilter":null,"validators":{"required":false},"allowCellFocus":true,"enableCellEditOnFocus":true,"enableSorting":true,"delete":false,"aggregationColumns":null,"rowAggregationType":null,"cellTooltip":true,"cellEditableCondition":true,"displayName":"Text Not Editible"},{"name":"Text Editable","width":"150","type":"string","enableCellEdit":true,"id":"gridcol-1525713163945","selectedCurrencyFilter":null,"footerCellFilter":null,"validators":{"required":false},"allowCellFocus":true,"enableCellEditOnFocus":true,"enableSorting":true,"delete":false,"aggregationColumns":null,"rowAggregationType":null,"cellTooltip":true,"cellEditableCondition":true,"editableCellTemplate":"ui-grid/cellEditor","displayName":"Text Editable"},{"name":"Type Subtotal in Euros","width":"*","type":"currency","enableCellEdit":true,"id":"gridcol-1525713443960","cellClass":"currency","footerCellClass":"currency","cellTemplate":" {{grid.getCellValue(row, col) | intCurrency:\"de-de\"}}","selectedCurrencyFilter":"de-de","footerCellFilter":"intCurrency:\"de-de\"","aggregationType":2,"validators":{"required":false},"allowCellFocus":true,"enableCellEditOnFocus":true,"enableSorting":true,"delete":false,"aggregationColumns":null,"rowAggregationType":null,"aggregationLabel":" ","cellEditableCondition":true,"editableCellTemplate":"ui-grid/cellEditor"},{"name":"Description","width":"*","type":"string","enableCellEdit":true,"id":"gridcol-1525713561745","customCellClass":"RightAligned","selectedCurrencyFilter":null,"footerCellFilter":null,"validators":{"required":false},"allowCellFocus":true,"enableCellEditOnFocus":true,"enableSorting":false,"delete":false,"cellEditableCondition":true,"editableCellTemplate":"ui-grid/cellEditor","displayName":"Description","cellTooltip":true},{"name":"Receipt 1","width":"*","type":"FileAttachment","enableCellEdit":true,"id":"gridcol-1525714400966","cellTemplate":"","selectedCurrencyFilter":null,"footerCellFilter":null,"question":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment"},"validators":{"required":false},"allowCellFocus":false,"enableCellEditOnFocus":false,"enableSorting":false,"delete":false,"aggregationColumns":null,"rowAggregationType":null,"editableCellTemplate":"","cellEditableCondition":true,"displayName":"Receipt 1"},{"name":"Receipt 2","width":"*","type":"FileAttachment","enableCellEdit":true,"id":"gridcol-1525714428776","cellTemplate":"","selectedCurrencyFilter":null,"footerCellFilter":null,"question":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment"},"validators":{"required":false},"allowCellFocus":false,"enableCellEditOnFocus":false,"enableSorting":false,"delete":false,"aggregationColumns":null,"rowAggregationType":null,"editableCellTemplate":"","cellEditableCondition":true,"displayName":"Receipt 2"}],"data":[{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":0,"Text_Editable":"Airline Tickets","Static_Text":"Airline Tickets","Text_Not_Editible":"Airline Tickets","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Airline Tickets","Text Editable":"Airline Tickets","Text Not Editible":"Airline Tickets"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":1,"Text_Editable":"Taxis / Rental Cars","Static_Text":"Taxis / Rental Cars","Text_Not_Editible":"Taxis / Rental Cars","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Taxis / Rental Cars","Text Editable":"Taxis / Rental Cars","Text Not Editible":"Taxis / Rental Cars"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":2,"Text_Editable":"Hotels","Static_Text":"Hotels","Text_Not_Editible":"Hotels","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Hotels","Text Editable":"Hotels","Text Not Editible":"Hotels"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":3,"Text_Editable":"Meals","Static_Text":"Meals","Text_Not_Editible":"Meals","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Meals","Text Editable":"Meals","Text Not Editible":"Meals"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":4,"Text_Editable":"Parking","Static_Text":"Parking","Text_Not_Editible":"Parking","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Parking","Text Editable":"Parking","Text Not Editible":"Parking"}],"showAddRowButton":false,"showColumnFooter":true,"filterContainer":"headerCell","menuButtonTemplate":"ui-grid/ui-grid-menu-button","menuItemTemplate":"ui-grid/uiGridMenuItem"},"new":false,"id":1525712968400,"events":{"onChange":null,"onBlur":null,"onFocus":null},"loaded":true,"isdirty":false,"originalAnswer":[{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":0,"Text_Editable":"Airline Tickets","Static_Text":"Airline Tickets","Text_Not_Editible":"Airline Tickets","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Airline Tickets","Text Editable":"Airline Tickets","Text Not Editible":"Airline Tickets"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":1,"Text_Editable":"Taxis / Rental Cars","Static_Text":"Taxis / Rental Cars","Text_Not_Editible":"Taxis / Rental Cars","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Taxis / Rental Cars","Text Editable":"Taxis / Rental Cars","Text Not Editible":"Taxis / Rental Cars"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":2,"Text_Editable":"Hotels","Static_Text":"Hotels","Text_Not_Editible":"Hotels","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Hotels","Text Editable":"Hotels","Text Not Editible":"Hotels"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":3,"Text_Editable":"Meals","Static_Text":"Meals","Text_Not_Editible":"Meals","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Meals","Text Editable":"Meals","Text Not Editible":"Meals"},{"Type_Subtotal_in_Euros":null,"Receipt_2":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"Receipt_1":{"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","readonly":false},"rowIndex":4,"Text_Editable":"Parking","Static_Text":"Parking","Text_Not_Editible":"Parking","Receipt 1":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Receipt 2":{"events":{"onChange":null},"Answer":[],"show":true,"class":"gridFileAttachment","ClientID":"","flex":100,"Label":"File Attachment: ","QuestionType":"FileAttachment","validation":{}},"Static Text":"Parking","Text Editable":"Parking","Text Not Editible":"Parking"}],"islive":false,"cellTemplates":{"date":"\n {{row.entity[col.field] | intDate:false}}\n "},"buttons":{"show":true,"delete":{"show":false,"disabled":true},"add":{"show":false,"disabled":false}},"showEditPanel":false,"showLabel":false,"validation":{}}]}],"icon":"crop_square","displayName":"Container"}],"showSectionOutline":true,"showAsCollapsible":true,"Label":"Fixed Grid Example","displayName":"Section"}],"version":1,"rules":[],"script":"// NOTE: If this form is being imported, please see comments below covering\r\n// 'Button: Process Checked Rows'\r\n\r\n/*******************************************************************************\r\n *\r\n * Global Variables to Support Programmatic Access to Questions & Components\r\n *\r\n * ****************************************************************************/\r\nvar grdDynamicGrid = intForm.getElementByClientID('grdDynamicGrid');\r\nvar numHiddenTotalExpenses = intForm.getElementByClientID('numHiddenTotalExpenses');\r\nvar numAirlineTickets = intForm.getElementByClientID('numAirlineTickets');\r\nvar numTaxisRentalCars = intForm.getElementByClientID('numTaxisRentalCars');\r\nvar numHotels = intForm.getElementByClientID('numHotels');\r\nvar numMeals = intForm.getElementByClientID('numMeals');\r\nvar numParking = intForm.getElementByClientID('numParking');\r\n\r\nvar btnHideShowButtons = intForm.getElementByClientID('btnHideShowButtons');\r\nvar btnHideShowFooter = intForm.getElementByClientID('btnHideShowFooter');\r\nvar btnProcessCheckedRows = intForm.getElementByClientID('btnProcessCheckedRows');\r\nvar btnPreventAllowDelete = intForm.getElementByClientID('btnPreventAllowDelete');\r\nvar btnAlignAmountRightLeft = intForm.getElementByClientID('btnAlignAmountRightLeft');\r\n\r\n/*******************************************************************************\r\n * \r\n * clearTotals() - Helper Function\r\n * \r\n * ****************************************************************************/\r\nfunction clearTotals(){\r\n numHiddenTotalExpenses.Answer = 0;\r\n numAirlineTickets.Answer = 0;\r\n numTaxisRentalCars.Answer = 0;\r\n numHotels.Answer = 0;\r\n numMeals.Answer = 0;\r\n numParking.Answer = 0; \r\n}\r\n\r\n/*******************************************************************************\r\n * \r\n * Button: Clear Grid\r\n * \r\n * ****************************************************************************/\r\nintForm.getElementByClientID('btnClear').events.onClick = function() {\r\n grdDynamicGrid.Answer = [];\r\n grdDynamicGrid.gridOptions.data = [];\r\n clearTotals(); // Since Dynamic Grid is empty, totals should be cleared too\r\n}\r\n \r\n/*******************************************************************************\r\n *\r\n * Initialize expense total and subtotals to zero if not prefilled\r\n *\r\n * ****************************************************************************/\r\nif (numHiddenTotalExpenses.Answer === null) numHiddenTotalExpenses.Answer = 0;\r\nif (numAirlineTickets.Answer === null) numAirlineTickets.Answer = 0;\r\nif (numTaxisRentalCars.Answer === null) numTaxisRentalCars.Answer = 0;\r\nif (numHotels.Answer === null) numHotels.Answer = 0;\r\nif (numMeals.Answer === null) numMeals.Answer = 0;\r\nif (numParking.Answer === null) numParking.Answer = 0;\r\n\r\nconsole.clear();\r\nconsole.log('Empty Dynamic Grid:')\r\nconsole.log(JSON.stringify(grdDynamicGrid, undefined, 2));\r\n// console.log(grdDynamicGrid);\r\n\r\n/*******************************************************************************\r\n *\r\n * When Dynamic Grid is Changed, access row / column data as needed\r\n *\r\n * ****************************************************************************/\r\ngrdDynamicGrid.events.onChange = function() {\r\n //\r\n // Initialize Total and Subtotals\r\n //\r\n clearTotals();\r\n //\r\n // Loop through any rows in grid\r\n //\r\n for (var i = 0; i < grdDynamicGrid.Answer.length; i++) {\r\n //\r\n // If Employees Covered is null, default to 1\r\n //\r\n if (grdDynamicGrid.Answer[i][\"Employees Covered\"] === null)\r\n grdDynamicGrid.Answer[i][\"Employees Covered\"] = 1;\r\n //\r\n // Grab Amount in Row\r\n //\r\n var amount = 0;\r\n if (grdDynamicGrid.Answer[i].Amount !== null)\r\n amount = parseFloat(grdDynamicGrid.Answer[i].Amount); // parseFloat prevents concatenate\r\n //\r\n // Apply Amount to Hidden Total & Appropriate Expense Type Subtotal\r\n //\r\n numHiddenTotalExpenses.Answer += amount;\r\n\r\n if (grdDynamicGrid.Answer[i][\"Expense Type\"].Answer === 'Airline Tickets')\r\n numAirlineTickets.Answer += amount;\r\n else if (grdDynamicGrid.Answer[i][\"Expense Type\"].Answer === 'Taxis / Rental Cars')\r\n numTaxisRentalCars.Answer += amount;\r\n else if (grdDynamicGrid.Answer[i][\"Expense Type\"].Answer === 'Hotels')\r\n numHotels.Answer += amount;\r\n else if (grdDynamicGrid.Answer[i][\"Expense Type\"].Answer === 'Meals')\r\n numMeals.Answer += amount;\r\n else if (grdDynamicGrid.Answer[i][\"Expense Type\"].Answer === 'Parking')\r\n numParking.Answer += amount;\r\n }\r\n \r\n //\r\n // Alternative to calculating total, if grid footer exists, it can be accessed\r\n //\r\n // Warning: When Grid Footer is Hidden, it is not updated\r\n //\r\n if (typeof grdDynamicGrid.getFooterValues('Amount') === 'undefined')\r\n alert(\"Grid Changed. Subtotals Recalculated.\\n\\nGrid Footer grdDynamicGrid.getFooterValues('Amount') is undefined.\");\r\n else\r\n alert('Grid Changed. Subtotals Recalculated.\\n\\nGrid Footer: $ ' + grdDynamicGrid.getFooterValues('Amount').toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\"));\r\n} \r\n\r\n/*******************************************************************************\r\n *\r\n * Button: Hide / Show (Grid) Buttons\r\n *\r\n * ****************************************************************************/\r\nbtnHideShowButtons.events.onClick = function() {\r\n//\r\n// If ADD is hidden, then hide both buttons\r\n//\r\n if (grdDynamicGrid.buttons.add.show === false) {\r\n grdDynamicGrid.buttons.add.show = true; // Unhide ADD-specific control\r\n grdDynamicGrid.buttons.show = false\r\n }\r\n//\r\n// Else if ADD and DELETE are hidden, show both\r\n//\r\n else if (grdDynamicGrid.buttons.show === false)\r\n grdDynamicGrid.buttons.show = true;\r\n//\r\n// Else hide the ADD button\r\n//\r\n else grdDynamicGrid.buttons.add.show = false;\r\n}\r\n\r\n/*******************************************************************************\r\n *\r\n * Button: Hide / Show Footer\r\n *\r\n * ****************************************************************************/\r\nbtnHideShowFooter.events.onClick = function() {\r\n grdDynamicGrid.gridOptions.showColumnFooter = !grdDynamicGrid.gridOptions.showColumnFooter;\r\n if (grdDynamicGrid.gridOptions.showColumnFooter === false)\r\n alert('\\n2018-05-16 WARNING:\\n===============\\nWhile the Grid Footer is hidden, it is not updated.');\r\n}\r\n\r\n/*******************************************************************************\r\n *\r\n * Button: Process Checked Rows\r\n *\r\n * ****************************************************************************/\r\n//\r\n// Helper function to remove all hash & id keys from checked row clone\r\n//\r\n// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING\r\n//\r\n// On 6/25/2018, when this form was imported into another Instance it only had\r\n// one dollar sign in front of the 'hashkey' literal below. For processing to \r\n// work correctly, correcting to two dollar signs was required.\r\n//\r\n// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING\r\n//\r\nfunction deIdentify(obj){\r\n for(key in obj){\r\n if(obj[key] !== null && typeof(obj[key]) === 'object'){\r\n deIdentify(obj[key])\r\n } \r\n if(key === '$$hashKey' || key === 'ClientID' || key === 'id'){\r\n delete obj[key]\r\n }\r\n }\r\n}\r\n\r\nbtnProcessCheckedRows.events.onClick = function() {\r\n\r\n if (grdDynamicGrid.Answer !== null && grdDynamicGrid.Answer.length > 0) {\r\n\r\n var Checks = 0;\r\n for (var i = 0; i < grdDynamicGrid.Answer.length; i++) {\r\n if (grdDynamicGrid.Answer[i].delete === true) {\r\n Checks += 1;\r\n //\r\n // Duplicate by Cloning Row and Stripping Out Identifier Stuff\r\n //\r\n var dup = [];\r\n dup = JSON.parse(JSON.stringify(grdDynamicGrid.Answer[i])); // CLONE ROW\r\n dup.delete = false; // Uncheck so new row will not be processed!!!\r\n\r\n deIdentify(dup);\r\n \r\n //\r\n // Process Step 1: APPEND Copy of Original at bottom of grid\r\n //\r\n // NOTE: INSERT after current location is possible with: \r\n //\r\n // grdDynamicGrid.Answer.splice(i+1,0,dup); \r\n //\r\n // But changes to the Select List and File Attachments will not trigger\r\n // onChange unless you explicitly add the following property to \r\n // Select List & File Attachment question types in the 'dup' object:\r\n //\r\n // \"events\" : { onChange : function() { grdDynamicGrid.events.onChange() } } \r\n //\r\n grdDynamicGrid.addRow(dup); // APPEND copy of checked row\r\n\r\n //\r\n // Additionally of note:\r\n //\r\n // grid.addRow(rowObject); // Adds a row object\r\n // grid.addRow(); // Adds a blank row object\r\n // grid.getRowObject(); // Returns a valid, blank row object\r\n\r\n //\r\n // Process Step 2: Modify Existing Row\r\n //\r\n grdDynamicGrid.Answer[i][\"On Company AMX\"] = !grdDynamicGrid.Answer[i][\"On Company AMX\"]; // Toggle on-AMX switch\r\n grdDynamicGrid.Answer[i].Amount = grdDynamicGrid.Answer[i].Amount * 2; // Double Amount\r\n grdDynamicGrid.Answer[i][\"Employees Covered\"] = grdDynamicGrid.Answer[i][\"Employees Covered\"] * 10 + 1; // Make 1 -> 11, 11 -> 111 ...\r\n grdDynamicGrid.Answer[i].delete = false; // Clear the check\r\n }\r\n }\r\n if (Checks === 0) alert('ERROR: No checked row was found!');\r\n else {\r\n var warn = ''\r\n warn = '\\nNOTE:\\n=====\\nProcessed ' + Checks + ' checked row(s), '\r\n warn += 'where processing means appending duplicate and modifing elements of original.';\r\n alert(warn);\r\n\r\n//\r\n// NOTE: INSERT (aka splice) method requires the following to correctly\r\n// recalculate/render, whereas the newer addRow() method correctly addresses\r\n// \r\n// grdDynamicGrid.gridOptions.showColumnFooter = !grdDynamicGrid.gridOptions.showColumnFooter; // hide & show footer..\r\n// setTimeout(function() {\r\n// grdDynamicGrid.gridOptions.showColumnFooter = !grdDynamicGrid.gridOptions.showColumnFooter; //..to refresh total\r\n// grdDynamicGrid.events.onChange(); // trigger grid onChange to recalculate subtotals\r\n// }, 100);\r\n//\r\n\r\n }\r\n } else alert('ERROR: No rows in grid to process!');\r\n}\r\n\r\n/*******************************************************************************\r\n *\r\n * Button: Prevent / Allow Delete\r\n *\r\n * ****************************************************************************/\r\nbtnPreventAllowDelete.events.onClick = function() {\r\n grdDynamicGrid.gridOptions.allowUsersToDeleteRows = !grdDynamicGrid.gridOptions.allowUsersToDeleteRows;\r\n grdDynamicGrid.showDeleteButton(!grdDynamicGrid.buttons.delete.show);\r\n grdDynamicGrid.showDeleteColumn(!grdDynamicGrid.gridOptions.columnDefs[0].visible);\r\n}\r\n\r\n/*******************************************************************************\r\n *\r\n * Button: Align Amount Right / Left (require form-defined CSS currency & highlighted)\r\n *\r\n * ****************************************************************************/\r\nbtnAlignAmountRightLeft.events.onClick = function() {\r\n if (!grdDynamicGrid.gridOptions.columnDefs[3].cellClass) {\r\n grdDynamicGrid.gridOptions.columnDefs[3].headerCellClass = \"currency highlighted\"; // Header\r\n grdDynamicGrid.gridOptions.columnDefs[3].footerCellClass = \"currency highlighted\"; // Footer\r\n grdDynamicGrid.gridOptions.columnDefs[3].cellClass = \"currency\"; // Values\r\n } else {\r\n grdDynamicGrid.gridOptions.columnDefs[3].headerCellClass = \"\"; // Header\r\n grdDynamicGrid.gridOptions.columnDefs[3].footerCellClass = \"\"; // Footer\r\n grdDynamicGrid.gridOptions.columnDefs[3].cellClass = \"\"; // Values\r\n }\r\n grdDynamicGrid.refreshGrid(); // Refresh Grid to show changes\r\n}\r\n\r\n/*******************************************************************************\r\n *\r\n * Techniques with Special Considerations:\r\n *\r\n * 1) Dynamically Making an entire column Read Only\r\n * 2) Accessing Prefilled Values to Calculate / Alter Grid or Element on Load\r\n *\r\n * ****************************************************************************/\r\n/*\r\n 1) Dynamically Making Entire Column Read Only\r\n\r\n When the form is being rendered within a task, it is possible to dynamically\r\n make an entire grid column read-only. The same attempt will throw an error\r\n on the console if via Form View in Request Detail. As such, you should check\r\n for that state before attempting:\r\n\r\n gridSales.gridOptions.columnDefs[1].enableCellEdit = false;\r\n\r\n 2) Accessing Grid Prefilled Values to Calculate / Alter basic Question/Elements\r\n\r\n When there is a need to access grid values for calculation or altering\r\n form behavior using a grid being prefilled, the grid will not be immediately\r\n available. Instead there is an array accessed via .prefillValues[] that can\r\n be read and altered. Here's an example:\r\n\r\n var totApproved = 0;\r\n\r\n if (gridSales.prefillValues !== null)\r\n for(var i=0;i