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.

135 lines (121 loc) 3.88 kB
/** * @class Ext.ux.grid.filter.StringFilter * @extends Ext.ux.grid.filter.Filter * Filter by a configurable Ext.form.field.Text * <p><b><u>Example Usage:</u></b></p> * <pre><code> var filters = Ext.create('Ext.ux.grid.GridFilters', { ... filters: [{ // required configs type: 'string', dataIndex: 'name', // optional configs value: 'foo', active: true, // default is false iconCls: 'ux-gridfilter-text-icon' // default // any Ext.form.field.Text configs accepted }] }); * </code></pre> */ Ext.define('Ext.ux.grid.filter.StringFilter', { extend: 'Ext.ux.grid.filter.Filter', alias: 'gridfilter.string', /** * @cfg {String} iconCls * The iconCls to be applied to the menu item. * Defaults to <tt>'ux-gridfilter-text-icon'</tt>. */ iconCls : 'ux-gridfilter-text-icon', emptyText: 'Enter Filter Text...', selectOnFocus: true, width: 125, /** * @private * Template method that is to initialize the filter and install required menu items. */ init : function (config) { Ext.applyIf(config, { enableKeyEvents: true, iconCls: this.iconCls, hideLabel: true, listeners: { scope: this, keyup: this.onInputKeyUp, el: { click: function(e) { e.stopPropagation(); } } } }); this.inputItem = Ext.create('Ext.form.field.Text', config); this.menu.add(this.inputItem); this.updateTask = Ext.create('Ext.util.DelayedTask', this.fireUpdate, this); }, /** * @private * Template method that is to get and return the value of the filter. * @return {String} The value of this filter */ getValue : function () { return this.inputItem.getValue(); }, /** * @private * Template method that is to set the value of the filter. * @param {Object} value The value to set the filter */ setValue : function (value) { this.inputItem.setValue(value); this.fireEvent('update', this); }, /** * @private * Template method that is to return <tt>true</tt> if the filter * has enough configuration information to be activated. * @return {Boolean} */ isActivatable : function () { return this.inputItem.getValue().length > 0; }, /** * @private * Template method that is to get and return serialized filter data for * transmission to the server. * @return {Object/Array} An object or collection of objects containing * key value pairs representing the current configuration of the filter. */ getSerialArgs : function () { return {type: 'string', value: this.getValue()}; }, /** * Template method that is to validate the provided Ext.data.Record * against the filters configuration. * @param {Ext.data.Record} record The record to validate * @return {Boolean} true if the record is valid within the bounds * of the filter, false otherwise. */ validateRecord : function (record) { var val = record.get(this.dataIndex); if(typeof val != 'string') { return (this.getValue().length === 0); } return val.toLowerCase().indexOf(this.getValue().toLowerCase()) > -1; }, /** * @private * Handler method called when there is a keyup event on this.inputItem */ onInputKeyUp : function (field, e) { var k = e.getKey(); if (k == e.RETURN && field.isValid()) { e.stopEvent(); this.menu.hide(); return; } // restart the timer this.updateTask.delay(this.updateBuffer); } });