{I" class:ETI"ProcessedAsset;FI"logical_path;TI"#netzke/testing/helpers/grid.js;FI" pathname;TI"i/Users/mxgrn/code/netzke/netzke-testing/app/assets/javascripts/netzke/testing/helpers/grid.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+Ù=UI" length;Ti£I" digest;TI"%df048060d0cd553ddec4c95cd8641012;FI" source;TI"£(function() { Ext.apply(window, { grid: function(value, lookup) { lookup = lookup || 'title'; if (value && lookup === 'title') { return Ext.ComponentQuery.query('grid[title="' + value + '"]')[0] || Ext.ComponentQuery.query('treepanel[title="' + value + '"]')[0]; } else if (value && lookup === 'name') { return Ext.ComponentQuery.query('grid[name="' + value + '"]')[0] || Ext.ComponentQuery.query('treepanel[name="' + value + '"]')[0]; } else { return Ext.ComponentQuery.query('grid{isVisible(true)}')[0] || Ext.ComponentQuery.query('treepanel{isVisible(true)}')[0]; } }, expandRowCombo: function(field, params) { var column, editor, g; g = g || this.grid(); editor = g.getPlugin('celleditor'); column = g.headerCt.items.findIndex('name', field) - 1; editor.startEditByPosition({ row: g.getSelectionModel().getCurrentPosition().rowIdx, column: column }); return editor.activeEditor.field.onTriggerClick(); }, addRecords: function() { var j, len, params, record; params = arguments[arguments.length - 1]; for (j = 0, len = arguments.length; j < len; j++) { record = arguments[j]; if (record !== params) { record = params.to.getStore().add(record)[0]; record.isNew = true; } } if (params.submit) { return click(button('Apply')); } }, addRecord: function(recordData, params) { var grid, record; params = params || []; grid = params.to || this.grid(); record = grid.getStore().add(recordData); return grid.getSelectionModel().select(grid.getStore().last()); }, updateRecord: function(recordData, params) { var grid, key, record, results, value; params = params || []; grid = params.to || this.grid(); record = grid.getSelectionModel().getSelection()[0]; results = []; for (key in recordData) { value = recordData[key]; results.push(record.set(key, value)); } return results; }, selectAssociation: function(attr, value, callback) { var action; action = function(cb) { expandRowCombo(attr); return wait(function() { select(value, { "in": combobox(attr) }); return cb(); }); }; if (callback) { return action(callback); } else { return new Promise(function(resolve, reject) { return action(resolve); }); } }, valuesInColumn: function(name, params) { var grid, out; if (params == null) { params = {}; } grid = params["in"] || this.grid(); out = []; grid.getStore().each(function(r) { var assocValue; assocValue = r.get('meta').associationValues[name]; return out.push(assocValue ? assocValue : r.get(name)); }); return out; }, valueInCell: function(column, row, params) { var assocValue, grid, r; if (params == null) { params = {}; } grid = params["in"] || this.grid(); r = grid.getStore().getAt(row); assocValue = r.get('meta').associationValues[column]; if (assocValue) { return assocValue; } else { return r.get(column); } }, selectAllRows: function(params) { var grid; if (params == null) { params = {}; } grid = params["in"] || this.grid(); return grid.getSelectionModel().selectAll(); }, rowDisplayValues: function(params) { var grid, i, record, visibleColumns; if (params == null) { params = {}; } grid = params["in"] || this.grid(); record = params.of || grid.getSelectionModel().getSelection()[0]; visibleColumns = []; Ext.each(grid.columns, function(c) { if (c.isVisible()) { return visibleColumns.push(c); } }); i = -1; return Ext.Array.map(Ext.DomQuery.select('table[data-recordid="' + record.internalId + '"] tbody tr td div'), function(cell) { i++; if (visibleColumns[i].attrType === 'boolean') { return record.get(visibleColumns[i].name); } else { return cell.innerHTML; } }); }, selectLastRow: function(params) { var grid; if (params == null) { params = {}; } grid = params["in"] || this.grid(); return grid.getSelectionModel().select(grid.getStore().last()); }, selectFirstRow: function(params) { var grid; if (params == null) { params = {}; } grid = params["in"] || this.grid(); return grid.getSelectionModel().select(grid.getStore().first()); }, selectRow: function(n, params) { var grid; if (params == null) { params = {}; } grid = params["in"] || this.grid(); return grid.getSelectionModel().select(n); }, editLastRow: function() { var data, grid, key, record, results, store; data = arguments[0]; grid = Ext.ComponentQuery.query("grid")[0]; store = grid.getStore(); record = store.last(); results = []; for (key in data) { results.push(record.set(key, data[key])); } return results; }, completeEditing: function(g) { var e; g = g || this.grid(); e = g.getPlugin('celleditor'); return e.completeEdit(); } }); }).call(this); ;TI"dependency_digest;TI"%532521c180247b8008c2696033e6fd98;FI"required_paths;T[I"i/Users/mxgrn/code/netzke/netzke-testing/app/assets/javascripts/netzke/testing/helpers/grid.js.coffee;FI"dependency_paths;T[{I" path;TI"i/Users/mxgrn/code/netzke/netzke-testing/app/assets/javascripts/netzke/testing/helpers/grid.js.coffee;F@I"2015-04-27T08:36:55+02:00;T@I"%0414eae40bb30d0e9fdac67f226d3940;FI" _version;TI"%4bf7b15359fe8e0974f7f263e26e27f4;F