store

How to filter multiple extjs grid columns?

徘徊边缘 提交于 2019-12-04 04:08:48
To filter one grid column we can use: { xtype: 'button', text:'Search', handler:function(){ store.clearFilter(); var searchValue = Ext.getCmp("textFieldId").getValue(); store.load().filter('GridFieldName', searchValue); } } but how to search multiple fields at once, something like: { xtype: 'button', text:'Search', handler:function(){ store.clearFilter(); var searchValue = Ext.getCmp("textFieldId").getValue(); store.filter([ {property: "GridFieldName", value: searchValue}, {property: "GridFieldName1", value: searchValue} ]); } } any ideas? EDIT: The weird thing is that in both cases, only

HTTP Headers with ExtJS 4 Stores

安稳与你 提交于 2019-12-04 04:06:14
I have already a few stores instanciated. But at a certain point, I'd to add a HTTP header in all of them. How can I do that, with ExtJS 4 ? Assuming that you are using an ajax proxy, you could update the headers property on the stores in question. Looking at the code it'll apply whatever is in there as the headers. A more involved solution would involve overriding the doRequest function to do whatever suited you. Robert Mitchell The answer provided by wombleton is close, but the key is that you have to set the headers property on the store's proxy , not on the store itself, e.g.: Ext

Store a dictionary in a file for later retrieval

こ雲淡風輕ζ 提交于 2019-12-04 03:28:58
I've had a search around but can't find anything regarding this... I'm looking for a way to save a dictionary to file and then later be able to load it back into a variable at a later date by reading the file. The contents of the file don't have to be "human readable" it can be as messy as it wants. Thanks - Hyflex EDIT import cPickle as pickle BDICT = {} ## Automatically generated START name = "BOB" name_title = name.title() count = 5 BDICT[name_title] = count name = "TOM" name_title = name.title() count = 5 BDICT[name_title] = count name = "TIMMY JOE" name_title = name.title() count = 5

ExtJS 4: cloning stores

余生长醉 提交于 2019-12-04 01:34:09
I'm trying to figure out how to clone an Ext.data.Store without keeping the old reference. Let me explain better with some code. Here's the source store: var source = Ext.create ('Ext.data.Store', { fields: ['name', 'age'] , data: [ {name: 'foo', age: 20} , {name: 'boo', age: 30} , {name: 'too', age: 10} , {name: 'yoo', age: 80} , {name: 'zoo', age: 30} ] }); Follows an example of what I want to do: var target = source; target.removeAll (); // Here I need to have target empty and source unchanged // But in this case, source is empty as well Now, in the above example the copy is done by

Mock ngrx store selectors with parameters in unit tests (Angular)

强颜欢笑 提交于 2019-12-03 22:28:46
I am trying to write unit tests for a service in Angular. I want to mock the store.select function of ngrx, so I can test how let's say, a service, reacts to different values returned by the store selectors. I want to be able to mock each selector individually. My main problem is how to mock parametrised selectors. I have previously used a BehaviourSubject that I map to the select function, but this doesn't allow you to return different values for different selectors. It is not readable because it is not obvious what selector you are mocking. Opt 1: Mock Store using subject: impossible to know

How do I store JSON data on a disk?

蓝咒 提交于 2019-12-03 17:43:51
问题 I am totally new to JSON and I might need to use it in the future so I did some reading bout it. There's lots of questions regarding JSON on SO. I found heaps of articles using google, I read json.org but I did not understand how to store JSON data. JSON is is a lightweight data-interchange format. So how I store its data? In a file ? In a database ? Does it matter? I can use it to pass the data to jsTree (jsTree is a javascript based, cross browser tree component. It is packaged as a jQuery

What is better? Password_hash vs. SHA256 vs. SHA1 vs. md5

守給你的承諾、 提交于 2019-12-03 17:35:40
问题 What is better with salt for password storage? MD5: $hash = md5($password . $salt); Password_hash: $hash = password_hash($password, PASSWORD_DEFAULT, $salt); SHA1: $result = sha1($salt.$string); 回答1: You should absolutely use the password_hash() function without providing your own salt: $hash = password_hash($password, PASSWORD_DEFAULT); The function will generate a safe salt on its own. The other algorithms are ways too fast to hash passwords and therefore can be brute-forced too easily

get single item from ngrx/store

老子叫甜甜 提交于 2019-12-03 15:59:30
问题 I've written the following reducer to store the state items in my Angular 2 app. The Items are price offers for Financial Instruments (e.g. stocks/currencies). My Reducer Implementation is as follows: export const offersStore = (state = new Array<Offer>(), action:Action) => { switch(action.type){ case "Insert": return [ ...state, action.payload ]; case "Update": return state.map(offer => { if(offer.Instrument === action.payload.Instrument) { return Object.assign({}, action.payload); } else

how to store video in database using mysql?

廉价感情. 提交于 2019-12-03 13:31:23
问题 I try to store a video file into database using MySQL, But i don't known how do store video file into database. I try following query but it didn't work. CREATE TABLE GAME ( GAME_ID INTEGER NOT NULL PRIMARY KEY, GAME_NAME VARCHAR (20), VIDEO LONGBLOB ); INSERT INTO GAME VALUES(3, "Termonator2", LOAD_FILE("C:\Users\Public\Videos\Sample Videos")); Please give me any reference or hint. Any help is appreciated. 回答1: you need to add two slash in path. Check following query.it's work with me. use

Set minimum iPhone OS version for app?

自古美人都是妖i 提交于 2019-12-03 13:20:47
I'm about to publish an app on the app store, and I'm looking to set the minimum OS version as it appears in iTunes as "Requires iPhone OS 3.x or later". 2 questions: 1) Where do I set this in my Xcode project? 2) I'm aware of the UITableViewCell numberOfLines property that is present only in OS > 3.1. If I set my minimum as OS 3.0, will people who have 3.1 be able to see the number of lines properly as I coded? (Obviously people on 3.0 won't be able to) Thanks. fbrereto What you need to do is change the Deployment Target setting in your project. The Deployment Target specifies the minimum OS