UNPKG

shubhadownloader

Version:

There is large amount of information available in market place. The markets are always in sync. In today's world investors find it very difficult to make effective use of information available to them. Shubha Downloader is great tool which resolves this problem and helps investor to increase his productivity and stay focused on decision making. Shubha Downloader enable end user to download market data from available sources and organize it. Shubha Downloader is Open source & FREE utility for end users. Shubha Downloader have main features as follows End of the day market data from web to your favorite charting application . Fundamental market data from web to your favorite charting application. Market reports from web to your favorite charting application.

94 lines (83 loc) 2.84 kB
/** * A Grid which creates itself from an existing HTML table element. */ Ext.define('Ext.ux.grid.TransformGrid', { extend: 'Ext.grid.Panel', /** * Creates the grid from HTML table element. * @param {String/HTMLElement/Ext.Element} table The table element from which this grid will be created - * The table MUST have some type of size defined for the grid to fill. The container will be * automatically set to position relative if it isn't already. * @param {Object} [config] A config object that sets properties on this grid and has two additional (optional) * properties: fields and columns which allow for customizing data fields and columns for this grid. */ constructor: function(table, config) { config = Ext.apply({}, config); table = this.table = Ext.get(table); var configFields = config.fields || [], configColumns = config.columns || [], fields = [], cols = [], headers = table.query("thead th"), i = 0, len = headers.length, data = table.dom, width, height, store, col, text, name; for (; i < len; ++i) { col = headers[i]; text = col.innerHTML; name = 'tcol-' + i; fields.push(Ext.applyIf(configFields[i] || {}, { name: name, mapping: 'td:nth(' + (i + 1) + ')/@innerHTML' })); cols.push(Ext.applyIf(configColumns[i] || {}, { text: text, dataIndex: name, width: col.offsetWidth, tooltip: col.title, sortable: true })); } if (config.width) { width = config.width; } else { width = table.getWidth() + 1; } if (config.height) { height = config.height; } Ext.applyIf(config, { store: { data: data, fields: fields, proxy: { type: 'memory', reader: { record: 'tbody tr', type: 'xml' } } }, columns: cols, width: width, height: height }); this.callParent([config]); if (config.remove !== false) { // Don't use table.remove() as that destroys the row/cell data in the table in // IE6-7 so it cannot be read by the data reader. data.parentNode.removeChild(data); } }, onDestroy: function() { this.callParent(); this.table.remove(); delete this.table; } });