nested

How to read nested JSON structure with a Sencha Touch Data Model?

戏子无情 提交于 2019-12-31 10:47:11
问题 I've been trying to figure this out all evening but to no avail. I have a JSON structure as follows (coming from another system so I can't change its structure): { "parents":{ "parent":[ { "parentId":1, "children":{ "child":[ { "childId":1, }, { "childId":2, } ] } }, { "parentId":2, "children":{ "child":[ { "childId":1, }, { "childId":2, } ] } } ], "pageNum":1, "pageSize":2 } } However, I can't figure out what the correct structure for the data models should be. I've tried the following but

Dynamic nested Material menu from json object in Angular 5

三世轮回 提交于 2019-12-31 10:33:24
问题 How to create dynamic nested menu from json object? I started using Angular Material Design today for the first time and I'm trying to create nested menus using material design. The documentation is pretty straight forward for static stuff. But I need to create dynamic nested menu from json object and I can't find a simple solution to this anywhere. It just needs to be one level deep. json object(not set in stone): my_menu = { 'main1': ['sub1', 'sub2'], 'main2': ['sub1', 'sub2'], } which

Dynamic nested Material menu from json object in Angular 5

人走茶凉 提交于 2019-12-31 10:33:22
问题 How to create dynamic nested menu from json object? I started using Angular Material Design today for the first time and I'm trying to create nested menus using material design. The documentation is pretty straight forward for static stuff. But I need to create dynamic nested menu from json object and I can't find a simple solution to this anywhere. It just needs to be one level deep. json object(not set in stone): my_menu = { 'main1': ['sub1', 'sub2'], 'main2': ['sub1', 'sub2'], } which

Accessing nested properties json

血红的双手。 提交于 2019-12-31 07:17:48
问题 I have this json: {"objects":[{"text":{"x":643,"y":71,"width":82,"height":33,"font":"Arial","style":"bold","size":24,"label":"Part A"}}, {"text":{"x":643,"y":116,"width":389,"height":42,"font":"Arial","style":"bold","size":16,"label":"What does \"novel\" mean as it is used in paragraph 8 of \"Turning Down a New Road\"? "}}, {"radiobutton":{"x":643,"y":170,"width":100,"height":20,"label":"A. old"}},{"radiobutton":{"x":643,"y":209,"width":100,"height":20,"label":"B. afraid"}}, {"radiobutton":{

Can I define Default Sort order in LinQ

心已入冬 提交于 2019-12-31 05:27:09
问题 If I have a nested ListView, and I'm calling a related table in LinQ, how do I sort it, without resorting to the ItemDataBound event of the parent? Pseudo Code (UPDATED WITH SOLUTION): <asp:ListView ID="lv" runat="server" OnItemDataBound="lv_ItemDataBound" > <LayoutTemplate> <!-- Product Category Stuff --> <asp:PlaceHolder Id="itemPlaceholder" runat="server"></asp:PlaceHolder> </LayoutTemplate> <ItemTemplate> <asp:ListView ID="lvInner" runat="server" DataSource='<%# <%# ((Category)Container

Nested User Controls - how to best get a reference to an ancestor control

别说谁变了你拦得住时间么 提交于 2019-12-31 05:05:42
问题 I realize that a whole lot of code cannot fit here, but I am asking for general direction or pointer. I have .NET user controls nested six deep for an interactive gadget with (outer to inner) of : wrapper, tabs, panels, lists, rows, items. I am trying to get a reference to an ancestor control from a nested control. Specifically, I have this code in the code behind of a embedded "great great grand child" control. It works, but it is very ugly: MyTab _myTab = this.Parent.Parent.Parent.Parent

Parsing a JSON file with GSON

坚强是说给别人听的谎言 提交于 2019-12-31 04:58:08
问题 I'm having trouble reading a JSON file into a POJO. Let me give you a snippet of what my JSON file entails: { "Speidy": { "factionId": "2", "role": "ADMIN", "title": "", "power": 9.692296666666667, "powerBoost": 0.0, "lastPowerUpdateTime": 1337023306922, "lastLoginTime": 1337023306922, "chatMode": "PUBLIC" }, "ShadowSlayer272": { "factionId": "2", "role": "NORMAL", "title": "", "power": 0.8673466666666667, "powerBoost": 0.0, "lastPowerUpdateTime": 1336945426926, "lastLoginTime": 1336945426926

replacing an element in nested array ruby

送分小仙女□ 提交于 2019-12-31 04:53:05
问题 I'm having trouble locating where my issue is in my code. I want to replace specific elements with 'X' if they show up on a bingo board: class BingoBoard def initialize(board) @bingo_board = board end def number_letter @letter = ['B','I','N','G','O'].sample @number = rand(1..100) end def checker @number @bingo_board.map! do |n| if n.include?(@number) n.map! { |x| x == @number ? 'X' : x} else n end end end end this is the test i'm using to see if my code is running, but X never shows up and I

Ansible with_subelements nested levels

眉间皱痕 提交于 2019-12-31 04:17:07
问题 I'm trying to iterate through nested loops, much like this question: Ansible with_subelements I need to go an extra level deep though. The comment there (dated January 2017) states that additional levels of nesting are unsupported. Is this still the case? If not, how can I reference deeper levels? My data: dns: - name: Something prefix: st zones: - zone: something.com records: - record: testing.something.com type: TXT value: '"somethingtest"' ttl: 60 - name: Devthing prefix: dt zones: - zone:

Are overlapping HTML formatting tags always a bad practice?

爱⌒轻易说出口 提交于 2019-12-31 02:44:06
问题 Suppose I need to have a text with a bold and an italic part that overlap each other, like you see this sentence have. Now, I know the proper way is to completely separate CSS and HTML as in the top example, but it just seems like overkill. Writing it out in 3 spans like that and adding a separate class for bold and italic means your user will need to download quite a bit more data than if you just use an overlapping b and i tag like in the second example: .bold{ font-weight: bold; } .italic{