Search Results

Search found 2 results on 1 pages for 'karok'.

Page 1/1 | 1 

  • Struct containing a Map in a Map? (C++/STL)

    - by karok
    I was wondering if it was possible to create a struct containing a number of variables and a map in a map. What I have at the moment: typedef std::map<std::string,double> lawVariables; struct ObjectCustomData { std::string objectType; bool global_lock; std::map<std::string, lawVariables> lawData; }; This struct is then passed on to another function as a single data block for that object. The structure setup is as follows: Each object has a data block that contains: its ObjectType, a bool for a lock, and a varying number of "laws" that could look like this: law1 -> var_a = 39.3; -> var_g = 8.1; law8 -> var_r = 83.1; -> var_y = 913.3; -> var_a = 9.81; Firstly, I'm unsure whether I should be using a Map within a Map and secondly even if this would be valid, I'm unsure how to fill it with data and how to recall it afterwards. I looked at maps because then I can search (on a name) if a certain object has a certain law, and if that law has certain variables. (sorry for the first messy post appearance, hope this is better :) )

    Read the article

  • ExtJS combo setting problem

    - by Hubidubi
    Hi I run into an interesting problem while was using combos in input form. My form contains combos that get data from json stores. It works fine when adding new record, but when the form is opened for editing an existing record, sometimes the id appears as selected not its value (eg: there's 5 instead of "apple"). I think it tries to set the value before it finishes loading the combo. Is there a way to solve this? I put the code down here that creates combos: function dictComboMaker( store, fieldLabel, hiddenName, name, allowBlank, myToolTipp ) { comboo = { xtype : 'combo', id: 'id-'+name, allowBlank: allowBlank, fieldLabel : fieldLabel, forceSelection : true, displayField : 'value', valueField : 'id', editable: false, name: name, hiddenName : hiddenName, minChars : 2, mode: 'remote', triggerAction : 'all', store : store }; function dictJsonMaker(url) { store = new Ext.data.JsonStore({ root : 'results', // 1 fields : [ 'id','value' ], url : url, autoLoad: true}); return store; } var comboKarStore = dictJsonMaker('/service/karok'); var comboKar= dictComboMaker(comboKarStore, 'Kar', 'karid', 'kar', false, ''); // then comboKar is added to the form Hubidubi

    Read the article

1