store

extjs loading tree from json file using MVC

梦想的初衷 提交于 2019-12-11 01:16:19
问题 Hithere, I'm having a strange problem where when I load a tree from a json file it goes into a loop and displays the tree as follows (in a continous loop) -A -A -A -A My json { "success": true, "results": [ { "text": "number 1", "leaf": true }, { "text": "number 2", "leaf": true }, { "text": "number 3", "leaf": true }, { "text": "number 4", "expanded": true, "children":[ { "text": "number 4.1", "leaf": true }, { "text": "number 4.2", "leaf": true }, { "text": "number 4.3", "leaf": true } ]},

Karma unit test / STORE - state undefined

别说谁变了你拦得住时间么 提交于 2019-12-11 00:24:20
问题 Everything works OK when running the application but in the Account unit test it seems like none or my states have been initiated. Is there anything obvious I am doing wrong? Here is the error. Test error: The create selector in index.js is returning a function with undefined parameters but only during karma tests. Account.component.ts import { Component, OnInit, OnDestroy, ChangeDetectionStrategy } from '@angular/core'; import * as fromAuth from '../../../auth/store/reducers'; import { Store

Extjs Restful Store, Sending request in Batch?

邮差的信 提交于 2019-12-10 20:06:57
问题 I created a Grid component with the store configuration like this: //Create the store config.store = new Ext.data.Store({ restful: true, autoSave: false, batch: true, writer: new Ext.data.JsonWriter({ encode: false }), reader: new Ext.data.JsonReader({ totalProperty: 'total', root: 'data', fields: cfg.fields }), proxy: new Ext.data.HttpProxy({ url:cfg.rest, listeners:{ exception: { fn: function(proxy, type, action, options, response, arg) { this.fireEvent('exception', proxy, type, action,

defaultValue from xml preference file isn't stored - why?

浪子不回头ぞ 提交于 2019-12-10 19:45:37
问题 When the application is first startet, I'd like to store all default values I've defined in my prefences.xml by using the 'android:defaultValue' attribute, but some of them are not stored on the device - can someone tell me why? <?xml version="1.0" encoding="utf-8"?> <PreferenceCategory android:title="@string/prefs_cat_title_x"> <ListPreference android:key="@string/prefs_key_1" android:title="@string/prefs_title_1" android:summary="@string/prefs_summary_1" android:entries="@array/array1"

Treestore empty - is JSON valid?

末鹿安然 提交于 2019-12-10 18:45:57
问题 My code looks like this but there is there is no data in the store / tree. Is the JSON store-valid? Do I need a root on top of the JSON? What columns must be defined in the Tree panel? JSON: { "status" : { "status" : 0, "msg" : "Ok", "protocolversion" : "1.1.json" }, "value" : { "name" : "Root", "path" : "\/", "leaf" : false, "children" : [ { "name" : "subfolder1", "path" : "\/subfolder1", "leaf" : false, "children" : [] }, { "name" : "subfolder2", "path" : "\/subfolder2", "leaf" : false,

Store data without a database?

你。 提交于 2019-12-10 17:54:23
问题 If I would like to store emails, but don't have a database (e.g. MySQL), what should I do? The data should be accessible and writable from PHP, but regular "visitors" MUST NOT see the data. Hope you can help. 回答1: If your data not very large, you can use XML files. But if your data is important and you must secure it , you have to encrypt your data 回答2: You can put them in files :) $data; // Defined "somewhere" file_put_contents('filename.txt', $data); However, I suggest you to use a database

How to bind array to arrystore in order to populate combo in extjs

可紊 提交于 2019-12-10 13:39:38
问题 I am having array as var cars = new Array('audi','benz','citron','nissan','alto'); I want to add this data to arraystore like below var myStore = new Ext.data.ArrayStore({ data : cars , fields : ['names'] }); On Binding this array store to combo var myCombo = new Ext.form.ComboBox({ store: myStore , displayField: 'name', valueField: 'name', typeAhead: true, mode: 'local', forceSelection: true, triggerAction: 'all', emptyText: 'Select a state...', selectOnFocus: true, }); The combo is showing

Running into Typescript state type mismatch error inside of Redux store file

∥☆過路亽.° 提交于 2019-12-10 11:57:05
问题 It seems to me that I have all the types correct, however am I missing a different kind of Reducer type? IinitialAssetsState' is not assignable to type 'Reducer' The full error: Type '(state: { assets: never[]; portfolio: never[]; loading: boolean; } | undefined, action: any) => IinitialAssetsState' is not assignable to type 'Reducer'. Types of parameters 'state' and 'state' are incompatible. Type 'IinitialAssetsState | undefined' is not assignable to type '{ assets: never[]; portfolio: never

In ExtJs, how do I get an id after syncing a record to the store?

白昼怎懂夜的黑 提交于 2019-12-10 10:55:35
问题 If I have a store under ExtJs 4, how do I get an id from a newly added record after a sync occurs? For example, if I have a PersonStore set to autosync and I add a new person based on a form filled out by the users, I can add the new record to the store by doing the following; var values = button.up('form').getForm().getValues(), store = Ext.StoreMgr.lookup('PersonStore'), result; result = store.add(values); Since autosync is set to true, this sends over the new value to the backend where it

Can't store data fetched with jQuery JSONP

痴心易碎 提交于 2019-12-10 10:37:39
问题 I'm trying to fetch a bunch of photo data from Flickr via a jQuery AJAX call using JSONP, but I don't want to use the data right away. Instead, I'd like to preserve it for use later. In a complicated case, I'd like to let users perform different queries on the prefetched data. In a simpler case, I'd like to just load the next n images each time the user clicks a button. Right now, I'm testing just the most basic functionality below, which is adapted from the best answer to this question: