nested

Is there a way to hide some of nested objects in model?

I have some orders with nested items and the items have nested kinds. When i do a form_for @order in a view, then i would like to hide all the items that have their :registered attribute set to true <% form_for @order do |f| %> <% f.fields_for :items do |ff| %> <%# show all the items that have :registered == false %> <% end %> <...

double nested model

Hello, I have a model : todo which is nested to my organization and my project models. I don't know how to handle this case when I create a new todo because in my todo controller and in my view my code is linked to organization or to project. Is there a way to use the good one with a condition? Thanks in advance! ...

Gridview inline editing in nested usercontrols...rowediting event not fired

Hi I have a gridview which is placed in an Usercontrol. the gridview was created dynamically. when I place this usercontrol directly in an ASP - Webpage, every events (rowediting, rowupdating, etc.) works perfectly. when I place this usercontrol in another usercontrol, then the rowediting doesn't fire. I use a "asp:commandfield" with ...

Problem with MySQL nested cursors

I have the following bunch of code trying to update a field using 2 cursors the one inside the other. I use the first cursor just to get an id value (1st cursor) and then I get a list of other id values based on that id (2nd cursor). The problem is that the result set from the 2nd cursor contains the last id twice! I can't find the bug! ...

How can I get this string to convert back into the array?

I am trying to use jMonthCalendar to add some events from an XML feed into a calendar. In the original jMonthCalendar, the events are in an array that looks like this: var events = [ { "EventID": 1, "StartDateTime": new Date(2009, 5, 12), "Title": "10:00 pm - EventTitle1", "URL": "#", "Description": "This is a sample event description...

Rails: Nested Resource Content App Management Structure

I am new to rails, and working on an internal content management app. I have made a prototype, but feel that it is messy and there is a better way. I require the following: My current prototype uses the workflow (http://github.com/geekq/workflow) plugin to manage the state of both the project and topics. I have also looked into acts_as_...

How can I optimise this jquery (using Cycle plugin) code?

I'm a novice jquery developer and I wrote this code to create nested cycling divs using the JQuery Cycle plugin. I want to optimize this code because to be honest? It's working, but it's bad! real bad! Thank you! Note: Anyone can use this code if he finds the need to and modify it in any way. CSS: .divCycle1 { float: left; ...

Removing a block nested in a block via the local.xml file.

Hello, I'm trying to use my local.xml file (where I do all my updates to the layout) to remove a block that is nested in another block. I can easily remove a block via the <remove> tag, or using the unsetChild method, but I can't seem to remove a block that is nested in another block. Here is the line of code I am trying to remove (lo...

Nested Incrementing Lists XHTML + Slidy

I am new to XHTML and I could use a little bit of help. I am using a tool called 'Slidy' to help me put together a slideshow on the net, I would like to make an incremented list so that when you advance the slideshow (click or press the right arrow) the next item appears. This should be the case whether the next item is a new item in the...

Convert flat array to the multi-dimentional

I have an array with tree data (by parent id). I want to convert it to multidimensional array. What is the best way to achieve that? Is there any short function for that? Source array: $source = array( '0' => array( 'Menu' => array( 'id' => 45 'name' => 'Home' ...

Nested jQuery.each() - continue/break

Consider the following code: var sentences = [ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'Vivamus aliquet nisl quis velit ornare tempor.', 'Cras sit amet neque ante, eu ultrices est.', 'Integer id lectus id nunc venenatis gravida nec eget dolor.', 'Suspendisse imperdiet turpi...

Route to nested model/form for unsaved parent

I have a complex form for a model Schedule that belongs to a parent Listing model: class Listing < ActiveRecord::Base has_many :schedules, :dependent => :destroy accepts_nested_attributes_for :schedules, :allow_destroy => true, :reject_if => :all_blank ... end class Schedule < ActiveRecord::Base belongs_to :listing ... end ...

In QT & C++, Covert QMap<QString, QMap<QString, int> > to a single QVariant type.

Apparently QVariant (needed for QSettings class) supports creation from QMap<QString, QVariant> But trying to initialise something like this: QMap<QString, QVariant(QMap<QString, QVariant>)> i; Returns instantiated from here. <-- points to code above. function returning a function. So then i tried the QMap<QString, QVariant> overlo...

Question about nested loops

I am new to programming and having some problem figuring out nested loops. I have a list of data that I want to extract from a larger file. I am able to extract one item of data from the larger file successfully but I need to extract 100 different trials from this larger file of thousands of trials. Each trial is one line of data of the ...

nested forms with additional non-editable fields in child table

My application has got a parent and child table with a 'has_many' relationship. Now I have created a nested form as described in the tutorials (using accept_nested_attributes_for) and this works fine. Some information about my environment: Rails 2.3.8, authlogic In my child table is a additional field "user" (the reference to the curr...

jquery nested accordion problem

Hi there, First question ever asked at stackoverflow. So, problem is: Two accordion declarations on document.ready (jquery 1.4.2 and jquery ui 1.8.2): $(document).ready(function () { $("#accordion").accordion({ header: 'h3' }); $("#accordion2").accordion({ header: 'h4' }...

Nested template possibilities

Is the following valid?: template<typename T> class C { C1<C2<T>> someMember; }; ...

Nested templates with dependent scope

What is dependent scope and what is the meaning of typename in the context of the following error? $ make g++ -std=gnu++0x main.cpp main.cpp:18:10: error: need 'typename' before 'ptrModel<std::vector<Data> >::Type' because 'ptrModel<std::vector<Data> >' is a dependent scope make: *** [all] Error 1 /* * main.cpp */ #include <vector...

Nested UIScrollViews: horizontal scrolling

Hello, I'm trying to scroll horizontally through a set of pages, where pages are grouped by two (and can be zoomed both together). So far, my view hierarchy is: One outter UIScrollView that scrolls horizontally. Several inner UIScrollView that contains two pages each, scrolling horizontally too. The problem I have is that swiping qu...

Why do I get an error trying to refer a nested class in Ruby?

Why there is an error in the following example? class ClassA class ClassB end class ClassC def test ClassB.new end end end p ClassA::ClassC.new.test # => #<ClassA::ClassB:0x0000010103f860> class ClassA class ClassD def test ClassB.new end end end p ClassA::ClassD.new.test # => #<ClassA::ClassB:...