Search Results

Search found 2177 results on 88 pages for 'children'.

Page 4/88 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Apply the REL attibute automatically to posts using jQuery

    - by Couto
    Edited: I mean grouping as giving the same REL attibute to all IMGs in the same post, but each post has different REL as the example at the end of this question. So, I need to do the following: <div id="Blog1" class="widget Blog"> <div class="blog-posts hfeed"> <div class="post hentry uncustomized-post-template"> <a name="8829400899632947948"/> <div class="post-body entry-content"> <div id="8829400899632947948"> <div class="separator"> <a imageanchor="1" href="/images/outta.png"> <img src="/images/outta.png"/></a></div></div> <div style="clear: both;"/> </div> <div class="post-footer"> </div></div></div></div> I'm using jQuery and Colorbox. The first two DIVs are posts containers. I need to group the IMGs in each <div class="post hentry uncustomized-post-template"> using the REL attribute, like: 1 - Post 1.1 - IMG - REL="group0" 1.2 - IMG - REL="group0" 1.3 - IMG - REL="group0" 1.4 - IMG - REL="group0" 2 - Post 2.1 - IMG - REL="group1" 3 - Post 3.1 - IMG - REL="group2" 3.2 - IMG - REL="group2" I've tryied HAS, PARENT > CHILDREN and CHILDREN() from jQuery and REL: from Colorbox, but it seems I'm lacking somewhere in logic. Could someone help me?

    Read the article

  • Career day in kindergarten

    - by Péter Török
    I was invited to the kindergarten group of my elder daughter to talk and answer the kids' questions about my profession. There are 26 kids of age 4-6 in the group, plus 3 teachers who are fairly scared of anything related to programming and IT themselves, but bold enough to learn new tricks. I would have about 20-30 minutes, without projector or anything. They have an old computer though, which by its look may be a 486, and I am not even sure if it's functioning. My research turned up excellent earlier threads, with lots of good tips: How would you explain your job to a 5-year old? Career Day: how do I make “computer programmer” sound cool to 8 year olds? What things can I teach a group of children about programming in one day? My situation is different from each of the above though: the latter ones are concerned with older children, while the first one is about talking to a single kid (or elder person)—a group of 20 is a whole different challenge. How can I teach the kids and their teachers about programming in a fun way?

    Read the article

  • Iterate through all form fields within a specified DIV tag.

    - by user344255
    I need to be able to iterate through all the form fields within a specified DIV tag. Basically, any given DIV tag can have multiple form fields (which is easy enough to parse through), but it can also any number of tables or even additional DIV tags (adding additional levels of hierarchical layering). I've written a basic function that goes through each of the direct descendants of the parent node (in this case, the DIV tag) and it clears out its value. This part works fine. The problem is getting it to parse children when children (grandchildren) of their own. It winds up getting caught up in an infinite loop. In this case, I need be able to find all the form fields within DIV tag "panSomePanel", which will include some direct children (txtTextField1), but also some grandchildren who are within nested TABLE objects and/or nested DIV tags (radRadioButton, DESC_txtTextArea). Here is a sample DIV and its contents: <DIV id="panSomePanel"> <INPUT name="txtTextField1" type="text" id="txtTextField1" size="10"/><BR><BR> <TABLE id="tblRadioButtons" border="0"> <TR> <TD> <INPUT id="radRadioButton_0" type="radio" name="radRadioButton" value="1" /><LABEL for="radRadioButton_0">Value 1</LABEL> </TD> <TD> <INPUT id="radRadioButton_5" type="radio" name="radRadioButton" value="23" /><LABEL for="radRadioButton_5">Value 23</LABEL> </TD> </TR> <TR> <TD> <INPUT id="radRadioButton_1" type="radio" name="radRadioButton" value="2" /><LABEL for="radRadioButton_1">Value 2</LABEL> </TD> <TD> <INPUT id="radRadioButton_6" type="radio" name="radRadioButton" value="24" /><LABEL for="radRadioButton_6">Value 24</LABEL> </TD> </TR> <TR> <TD> <INPUT id="radRadioButton_2" type="radio" name="radRadioButton" value="3" /><LABEL for="radRadioButton_2">Value 3</LABEL> </TD> <TD> <INPUT id="radRadioButton_7" type="radio" name="radRadioButton" value="25" /><LABEL for="radRadioButton_7">Value 25</LABEL> </TD> </TR> <TR> <TD> <INPUT id="radRadioButton_3" type="radio" name="radRadioButton" value="21" /><LABEL for="radRadioButton_3">Value 21</LABEL> </TD> <TD> <INPUT id="radRadioButton_8" type="radio" name="radRadioButton" value="4" /><LABEL for="radRadioButton_8">Value 4</LABEL> </TD> </TR> <TR> <TD> <INPUT id="radRadioButton_4" type="radio" name="radRadioButton" value="22" /><LABEL for="radRadioButton_4">Value 22</LABEL> </TD> </TR> </TABLE> <DIV id="panAnotherPanel"><BR> <TABLE cellpadding="0" cellspacing="0" border="0" style="display:inline;vertical-align:top;"> <TR> <TD valign="top"> <TEXTAREA name="DESC:txtTextArea" rows="3" cols="48" id="DESC_txtTextArea"></TEXTAREA>&nbsp; </TD> <TD valign="top"><SPAN id="DESC_lblCharCount" style="font-size:8pt;"></SPAN> </TD> </TR> </TABLE> </DIV> </DIV> Here is the function I've written: function clearChildren(node) { var child; if (node.childNodes.length > 0) { child= node.firstChild; } while(child) { if (child.type == "text") { alert(child.id); child.value = ""; } else if (child.type == "checkbox") { child.checked = false; } else if (child.type == "radio") { alert(child.id); child.checked = false; } else if (child.type == "textarea") { child.innerText = ""; } //alert(child.childNodes.length); if (child.childNodes.length > 0) { var grandchild = child.firstChild; while (grandchild) { clearChildren(grandchild); } grandchild = grandchild.nextSibling; } child = child.nextSibling; } }

    Read the article

  • Loop XML including all its children using xpath and SimpleXMLElement

    - by Andersson
    Im having a big xml tree with a simple structure. All I want to do is get a node by its attribute using xpath and loop the children. param1 - correct language param1 & param3 - correct node by its id and the parents id. (Need to use parent id when multiplie id appears. The id is not declared as id in DTD) public function getSubmenuNodesRe($language, $id1,$id2) { $result = $this->xml->xpath("//*[@language='$language']//*[@id='$id1']//menuitem[@id='$id2']/*"); return $result; } This works well, I get the node Im expecting. I having no problems looping the array returned by the xpath query. But when i try to loop childnodes all attributes are gone and many of the methods also. Except getName(). function printNodeName($node) { echo $node->getName(). " - \"" . $node['id']. "\"<br>"; if($node->children()->getName() == "menuitem") { $s = $node->children(); printNodeName($s); } } $result = $xmlNode->getSubmenuNodesRe($_GET['language'], 'foo','bar'); if ($result) { while(list( , $node) = each($result)) { if ($node->getName() == "menuitem") { printNodeName($node); } } } Why is that? only the name will be printed for the $s. Really need help to solve this one, any assistance is deeply appreciated! Thanks for your time.

    Read the article

  • Find element all of whose children have a given value

    - by cru3l
    for example, i have this xml <elements> <a> <b>6</b> <b>5</b> <b>6</b> </a> <a> <b>5</b> <b>5</b> <b>6</b> </a> <a> <b>5</b> <b>5</b> <b>5</b> <b>5</b> </a> </elements> i need a xpath query, which must return me parent tag, only if all its children are equal to 5 (a[3] in this case). Something like that //b[text()="5"]/.. but with check of all children's tags. Please note that number of children tags can be different from node to node. It's possible with only xpath query? thanks

    Read the article

  • finding specific immediate children of an element using prototype

    - by tatilans
    Following DOM structure: <ul> <li class="item">yes</li> <li>no</li> <li class="item">yes</li> <li> <ul> <li class="item">no</li> </ul> </li> </ul> Assuming I have the outer <ul> in $ul. How do I get the two immediate children which have the item-class? In jQuery I would write something like this: $ul.children().filter(".item") $ul.children(".item") $ul.find("> .item") How do I to this with Prototype? I tried the following ... $ul.select("> .item") //WRONG ... but it does does exactly the opposite and returns the one inner <li>

    Read the article

  • Select form children when multiple forms are present jQuery

    - by afreeland
    I am dealing with a webpage that has multiple forms..some basic HTML forms and some AJAX forms. I have a created validation for inputs, let me give an example...if an input has a class="required" whenever a submit button is pressed if any required classes are empty then the form doesnt submit. Which works great...until you have multiple forms with required fields that dont apply to the section your submitting. I am able to find the closest form $(this).closest("form") and it gets me the form element properly, I then need to be able to loop only through the children of that form. I have tried: .children(':input'), .find('input') and honestly to many to list. Here is the code for when a button is selected $('#formSubmit').click(function (e) { var submit = true; var form = $(this).closest("form"); var formID = $(form).attr("id"); e.preventDefault(); $(form).children(":input").each(function () { if ($('#ERROR').length > 0) { submit = false; alert("Please fix errors to continue"); } $('.required').each(function () { if ($(this).val() == "" || $(this).val() == undefined) { submit = false; $(this).css({ 'background-color': '#fef236' }); } }); }); if (submit == true) { this.form.submit(); } }); //End of #formSubmit Also of interest I have started creating forms with ids that are GUID's so they will be unique and allow me to target things without any issues, just wanted to throw that out there if it can help lead to a solution I appreciate any help =)

    Read the article

  • Hibernate: update on parent-child relationship causes duplicate children

    - by TimmyJ
    I have a parent child relationship in which the parent has a collection of children (a set to be specific). The child collection is setup with cascade="all-delete-orphan". When I initially save the parent element everything works as expected. However, when I update the parent and save again, all the children are re-saved. This behavior leads me to believe that the parent is losing its reference to the collection of children, and therefore when persisting all the children are re-saved. It seems the only way to fix this is to not use the setter method of this child collection, but unfortunately this setter is called implicitly in my application (Spring MVC is used to bind a multi-select form element to this collection, and the setter is called by spring on the form submission). Overwriting this setter to not lose the reference (ie, do a colleciton.clear() and collection.addAll(newCollection) rather than collection = newCollection) is apparently a hibernate no-no, as is pointed out here: https://forum.hibernate.org/viewtopic.php?t=956859 Does anyone know how to circumvent this problem? I've posted some of my code below. The parent hibernate configuration: <hibernate-mapping package="org.fstrf.masterpk.domain"> <class name="ReportCriteriaBean" table="masterPkReportCriteria"> <id name="id" column="id"> <generator class="org.hibernate.id.IncrementGenerator" /> </id> <set name="treatmentArms" table="masterPkTreatmentArms" sort="org.fstrf.masterpk.domain.RxCodeComparator" lazy="false" cascade="all-delete-orphan" inverse="true"> <key column="runid"/> <one-to-many class="TreatmentArm"/> </set> </class> </hibernate-mapping> The parent object: public class ReportCriteriaBean{ private Integer id; private Set<TreatmentArm> treatmentArms; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Set<TreatmentArm> getTreatmentArms() { return treatmentArms; } public void setTreatmentArms(Set<TreatmentArm> treatmentArms) { this.treatmentArms = treatmentArms; if(this.treatmentArms != null){ for(TreatmentArm treatmentArm : this.treatmentArms){ treatmentArm.setReportCriteriaBean(this); } } } The child hibernate configuration: <hibernate-mapping package="org.fstrf.masterpk.domain"> <class name="TreatmentArm" table="masterPkTreatmentArms"> <id name="id" column="id"> <generator class="org.hibernate.id.IncrementGenerator" /> </id> <many-to-one name="reportCriteriaBean" class="ReportCriteriaBean" column="runId" not-null="true" /> <property name="rxCode" column="rxCode" not-null="true"/> </class> </hibernate-mapping> The child object: public class TreatmentArm { private Integer id; private ReportCriteriaBean reportCriteriaBean; private String rxCode; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public ReportCriteriaBean getReportCriteriaBean() { return reportCriteriaBean; } public void setReportCriteriaBean(ReportCriteriaBean reportCriteriaBean) { this.reportCriteriaBean = reportCriteriaBean; } public String getRxCode() { return rxCode; } public void setRxCode(String rxCode) { this.rxCode = rxCode; } }

    Read the article

  • jquery parent/children selector for counting <li>

    - by Kreker
    Hi. I have this piece of HTML <div id="fileTreeInviati"> <ul class="php-file-tree"> <li class="pft-directory"> <a href="#" class="" name="101">A006 - SOMETEXT (<span name="contaNew"></span>)</a> <img src="./moduli/home/images/info.png" title="Informazioni Azienda" class="imgInfo"/> <ul style="display: none;"> <li class="pft-file ext-png"> <a href="javascript:getInfoFile('4');" class="" id="4">cut.png</a> </li> <li class="pft-file ext-dll"> <a href="javascript:getInfoFile('27');" class="new" id="27">Safari.dll</a> </li> </ul> </li> <li class="pft-directory"> <a href="#" class="" name="102">A012 - SOMETEXT (<span name="contaNew"></span>)</a> <img src="./moduli/home/images/info.png" title="Informazioni Azienda" class="imgInfo"/> <ul style="display: none;"> <li class="pft-file ext-jpg"> <a href="javascript:getInfoFile('19');" class="new" id="19">04.jpg</a> </li> <li class="pft-file ext-dll"> <a href="javascript:getInfoFile('24');" class="new" id="24">Safari.dll</a> </li> </ul> </li> <li class="pft-directory"> <a href="#" class="" name="103">A014 - SOMETEXT (<span name="contaNew"></span>)</a> <img src="./moduli/home/images/info.png" title="Informazioni Azienda" class="imgInfo"/> <ul style="display: none;"> <li class="pft-file ext-txt"> <a href="javascript:getInfoFile('17');" class="new" id="17">acu.txt</a> </li> <li class="pft-file ext-dll"> <a href="javascript:getInfoFile('22');" class="new" id="22">Safari.dll</a> </li> </ul> </li> </ul> I'm working on a js snippet that cycle through all "a" of the "li" and checks if it has the class "new" if yes increment a counter by one. This counter now has to be printed on the relative "li" "span" 3 level before. So I have the number of the element with the "new" class. The js snippet is this $("#fileTreeInviati .php-file-tree .pft-directory li").each(function(){ $(this).children("a").each(function(i,e){ if ($(e).hasClass("new")){ cont++; console.log($(e).text()); $(this).parent().parent().parent().children("a").children("span").text(cont); } }) cont = 0; }); I think I'm almost there but the counter is always 1. I think there is something mess with .children, maybe it can handle only the first occurrence? Thanks for help

    Read the article

  • Cannot add namespace prefix to children using XSL

    - by Erdal
    I checked many answers here and I think I am almost there. One thing that is bugging me (and for some reason my peer needs it) follows: I have the following input XML: <?xml version="1.0" encoding="utf-8"?> <MyRoot> <MyRequest CompletionCode="0" CustomerID="9999999999"/> <List TotalList="1"> <Order CustomerID="999999999" OrderNo="0000000001" Status="Shipped"> <BillToAddress ZipCode="22221"/> <ShipToAddress ZipCode="22222"/> <Totals Tax="0.50" SubTotal="10.00" Shipping="4.95"/> </Order> </List> <Errors/> </MyRoot> I was asked to produce this: <ns:MyNewRoot xmlns:ns="http://schemas.foo.com/response" xmlns:N1="http://schemas.foo.com/request" xmlns:N2="http://schemas.foo.com/details"> <N1:MyRequest CompletionCode="0" CustomerID="9999999999"/> <ns:List TotalList="1"> <N2:Order CustomerID="999999999" Level="Preferred" Status="Shipped"> <N2:BillToAddress ZipCode="22221"/> <N2:ShipToAddress ZipCode="22222"/> <N2:Totals Tax="0.50" SubTotal="10.00" Shipping="4.95"/> </N2:Order> </ns:List> <ns:Errors/> </ns:MyNewRoot> Note the children of the N2:Order also needs N2: prefix as well as the ns: prefix for the rest of the elements. I use the XSL transformation below: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="/MyRoot"> <MyNewRoot xmlns="http://schemas.foo.com/response" xmlns:N1="http://schemas.foo.com/request" xmlns:N2="http://schemas.foo.com/details"> <xsl:apply-templates/> </MyNewRoot> </xsl:template> <xsl:template match="/MyRoot/MyRequest"> <xsl:element name="N1:{name()}" namespace="http://schemas.foo.com/request"> <xsl:copy-of select="namespace::*"/> <xsl:apply-templates select="@* | node()"/> </xsl:element> </xsl:template> <xsl:template match="/MyRoot/List/Order"> <xsl:element name="N2:{name()}" namespace="http://schemas.foo.com/details"> <xsl:copy-of select="namespace::*"/> <xsl:apply-templates select="@* | node()"/> </xsl:element> </xsl:template> </xsl:stylesheet> This one doesn't process the ns (I couldn't figure this out). When I process thru the above the XSL transformation with AltovaXML I end up with below: <MyNewRoot xmlns="http://schemas.foo.com/response" xmlns:N1="http://schemas.foo.com/request" xmlns:N2="http://schemas.foo.com/details"> <N1:MyRequest CompletionCode="0" CustomerID="9999999999"/> <List xmlns="" TotalList="1"> <N2:Order CustomerID="999999999" Level="Preferred" Status="Shipped"> <BillToAddress ZipCode="22221"/> <ShipToAddress ZipCode="22222"/> <Totals Tax="0.50" SubTotal="10.00" Shipping="4.95"/> </N2:Order> </List> <Errors/> </MyNewRoot> Note that N2: prefix for the children of Order is not there after the XSL transformation. Also additional xmlns="" in the Order header (for some reason). I couldn't figure out putting the ns: prefix for the rest of the elements (like Errors and List). First of all, why would I need to put the prefix for the children if the parent already has it. Doesn't the parent namespace dictate the children nodes/attribute namespaces? Secondly, I want to add the prefixes in the above XML as expected, how can I do that with XSL?

    Read the article

  • Red-Black trees - Erasing a node with two non-leaf children

    - by SalamiArmi
    Hi all, I've been implementing my own version of a red-black tree, mostly basing my algorithms from Wikipedia (http://en.wikipedia.org/wiki/Red-black_tree). Its fairly concise for the most part, but there's one part that I would like clarification on. When erasing a node from the tree that has 2 non-leaf (non-NULL) children, it says to move either side's children into the deletable node, and remove that child. I'm a little confused as to which side to remove from, based on that. Do I pick the side randomly, do I alternate betweek sides, or do I stick to the same side for every future deletion?

    Read the article

  • Career Day in kindergarten: how to demonstrate programming in 20 minutes?

    - by Péter Török
    I was invited to the kindergarten group of my elder daughter to talk, and aswer the kids' questions, about my profession. There are 26 kids of age 4-6 in the group (plus 3 teachers who are fairly scared of anything related to programming and IT themselves, but bold enough to learn new tricks). I would have about 20-30 minutes, without projector or anything. (They have an old computer though, which by its look may be a 486, and I am not even sure if it's functioning.) My research turned up excellent earlier threads, with lots of good tips: How would you explain your job to a 5-year old? Career Day: how do I make “computer programmer” sound cool to 8 year olds? What things can I teach a group of children about programming in one day? My situation is different from each of the above though. So any advice on how to teach the kids (and their teachers) in a fun way about programming is appreciated.

    Read the article

  • xml dom node children

    - by matt
    Need some help I've got lots of code and i want to make it shorter i know there's a way but I can't remember it this is code example: <?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="cooking"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book category="children"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> <book category="web"> <title lang="en">XQuery Kick Start</title> <author>James McGovern</author> <author>Per Bothner</author> <author>Kurt Cagle</author> <author>James Linn</author> <author>Vaidyanathan Nagarajan</author> <year>2003</year> <price>49.99</price> </book> <book category="web" cover="paperback"> <title lang="en">Learning XML</title> <author>Erik T. Ray</author> <year>2003</year> <price>39.95</price> </book> </bookstore As you can see the different nodes, children now is there a way to make this code smaller so I don't have to keep writing the nodes and children

    Read the article

  • Loop through children and display each, as3

    - by VideoDnd
    How do I loop through all of my children, and display each? I would like to know the best way to do this. my children and containerfive children, one plays every sec, 1,2,3, etc. var square1:Square1 = new Square1; var square2:Square2 = new Square2; var square3:Square3 = new Square3; var square4:Square4 = new Square4; var square5:Square5 = new Square5; var container:Sprite = new Sprite; addChild(container); container.addChild(square1) container.addChild(square2) container.addChild(square3) container.addChild(square4) container.addChild(square5) my timer var timly:Timer = new Timer(1000, 5); timly.start(); timly.addEventListener(TimerEvent.TIMER, onLoop); Note: Tried for loop, numChildren -1, and visibility ERROR 'access of undefined property' //Thomas's idea var timly:Timer = new Timer(1000, 10); timly.start(); timly.addEventListener(TimerEvent.TIMER, onLoop, false, 0, true); // var square1:Square1 = new Square1; square1.visible = false container.addChild(square2) var square2:Square2 = new Square2; square2.visible = false container.addChild(square3) var square3:Square3 = new Square3; square3.visible = false container.addChild(square3) var square4:Square4 = new Square4; square4.visible = false container.addChild(square4) var square5:Square5 = new Square5; square5.visible = false container.addChild(square5) var container:Sprite = new Sprite; this.addChild(container); var curCount:Number = 100; // function collectChildren(container:DisplayObjectContainer):Array { var len:int = container.numChildren; var mySquaresArray:Array = []; for (var i:int = 0; i < len; i++) { mySquaresArray.push(container.getChildAt(i).name); } return mySquaresArray; } // function onLoop( e:Event ) { curCount = e.target.currentCount; if( curCount > 1 ) { var previous_square = curCount -2; mySquaresArray[previous_square].visible = false; } var current_square = curCount - 1; mySquaresArray[current_square].visible = true; }

    Read the article

  • Clicking MDI children form doesn't bring it to front

    - by Steve
    This is a winform question in .net. In a MDI form, if I open several children forms, for some forms, if they are not activated (if you overlap them with the activate one, they are not up to front. Only the activate form is up to front.), clicking them don't bring them to front. This is even true if I click controls on them, such as a textbox. The textbox gets focus and you can intput things, but that form is still not activated. Interestingly enough, this is not the case for all the children forms I created. Some forms behave correctly but others don't. Did I do something wrong? I think the correct behavior is that, everytime I click a form, bring it up to front. Thank you for any suggestion.

    Read the article

  • What should I tell kids about how great it is to be a programmer?

    - by Sara Chipps
    I am putting a presentation together. I thought about illustrating with websites like Facebook, and MySpace. Does anyone have children around that age that could tell me what they are into? How to hold their attention? Ways to illustrate what we do? Get them interested? Your ideas are greatly appreciated, I really want to be able to convey how fun this is :). I don't have access to a digital projector... which really stinks. I do have access to an old transparency overhead, though. http://stackoverflow.com/questions/207278/career-day-how-do-i-make-computer-programmer-sound-cool-to-8-year-olds

    Read the article

  • d3 tree - parents having same children

    - by Larry Anderson
    I've been transitioning my code from JIT to D3, and working with the tree layout. I've replicated http://mbostock.github.com/d3/talk/20111018/tree.html with my tree data, but I wanted to do a little more. In my case I will need to create child nodes that merge back to form a parent at a lower level, which I realize is more of a directed graph structure, but would like the tree to accomodate (i.e. notice that common id's between child nodes should merge). So basically a tree that divides like normal on the way from parents to children, but then also has the ability to bring those children nodes together to be parents (sort of an incestual relationship or something :)). Asks something similar - How to layout a non-tree hierarchy with D3 It sounds like I might be able to use hierarchical edge bundling in conjunction with the tree hierarchy layout, but I haven't seen that done. I might be a little off with that though.

    Read the article

  • Accessing children of loaded swf in Flex Image component

    - by pfunc
    I am loading an external swf into an component. It loads everything fine and I can see buttons working in the swf, but I can't seem to figure out how to add children to this swf from the core mxml file. I have tried tracing out all the children of the image component but can't find where or how to do this. This is the image component: <Image id="image" mask="{ maskCanvas }" source="{ _source }" mouseDown="image.startDrag()" visible="{ _source != null &amp;&amp; image.percentLoaded == 100 }" showEffect="{ fadeInEffect }" complete="imageComplete()" doubleClickEnabled="true" doubleClick="onDoubleClick()" /> And in my AS, I am trying to do something like this: myComponent.image.addChild("myMC"); But i either don;t see the clip or there I get an error about not being able to add the child to a ui component.

    Read the article

  • find() or children() to search top-level children only for a style?

    - by user291701
    Hi, I'd like to find if a child element exists which has either of two class styles applied. My code looks like this: var listOfMatchedResults = $("#parentList").find(".myStyle1, .myStyle2"); My styles are defined like this: .parent li, .myStyle0 { } .parent li.myStyle1 { } .parent li.myStyle2 { } I don't need to traverse more than one level deeper than the children level, like: <ul id='parentList'> <li><p>foo</p><p>grok</p></li> <li class='myStyle2'><p>Here</p><p>I am!</p></li> <li><p>foo</p><p>grok</p></li> </ul> I'm not clear as to what find() is doing, is it going into each of the paragraph elements too? I just need it to traverse the top-level children - is there a way to specify that? Thank you

    Read the article

  • Codeigniter - selecting children and parents from db

    - by Tomek Buszewski
    I want to pull from my database records corresponding to parent_id, like this: function getChildren($id, $parent_id) { $q = $this->db->select('id, name, slug, plat'); $q = $this->db->from('games'); $q = $this->db->where('parent_id',$id); $q = $this->db->or_where('id',$parent_id); $q = $this->db->get(); return $q->result_array(); } It - if it's a children game - get parent_id and search for a game with such id and for other games that has parent_id same as this one. If it's the parent game, it only looks for games with parent_id same as it's id. The problem is... it's not always working. I have four games in db: id | parent_id | title 15 | 0 | Abe 19 | 15 | Abe 20 | 0 | RE2 21 | 20 | RE2 DS First two works, last two - only children (id = 21) shows parent.

    Read the article

  • jQuery - Cycling through child elements

    - by Dan
    Hi, I have a series of select boxes within a table like so: <tr> <td><select></select></td> <td><select></select></td> <td><select></select></td> <td><select></select></td> </tr> With about 10 rows. I'm trying to reset all of the select boxes in the row to a default value, but having trouble with the syntax, can anyone help? This is what I have at the moment, but it dosen't seem to be working: $(row).children('td > select').each().val('0'); Any advice appreciated. Thanks.

    Read the article

  • flex accessing children of a list component

    - by pfunc
    when I try to loop through the children of a List component that has buttons in it, I can't seem to access those children. I try for(var btnNum:Number = 0; btnNum < myList.numChildren; btnNum++) { trace(myList.getChildAt(btnNum); } but it is giving some other instance, not the button instances. and the weeklist <mx:List id="myList" dataProvider="{_data.mappoints.week.@number}" > <mx:itemRenderer > <mx:Component> <mx:Button buttonMode="true" toggle="true" alpha="1" width="116" height="35" label="WEEK {data}" > </mx:Button> </mx:Component> </mx:itemRenderer> </mx:List>

    Read the article

  • How can I get all children from a parent row in the same table?

    - by Johnny Freeman
    Let's say I have a table called my_table that looks like this: id | name | parent_id 1 | Row 1 | NULL 2 | Row 2 | NULL 3 | Row 3 | 1 4 | Row 4 | 1 5 | Row 5 | NULL 6 | Row 6 | NULL 7 | Row 7 | 8 8 | Row 8 | NULL 9 | Row 9 | 4 10 | Row 10 | 4 Basically I want my final array in PHP to look like this: Array ( [0] => Array ( [name] => Row 1 [children] => Array ( [0] => Array ( [name] => Row 3 [children] => ) [1] => Array ( [name] => Row 4 [children] => Array ( [0] => Array ( [name] => Row 9 [children] => ) [1] => Array ( [name] => Row 10 [children] => ) ) ) ) ) [1] => Array ( [name] => Row 2 [children] => ) [2] => Array ( [name] => Row 5 [children] => ) [3] => Array ( [name] => Row 6 [children] => ) [4] => Array ( [name] => Row 8 [children] => Array ( [0] => Array ( [name] => Row 7 [children] => ) ) ) ) So, I want it to get all of the rows where parent_id is null, then find all nested children recursively. Now here's the part that I'm having trouble with: How can this be done with 1 call to the database? I'm sure I could do it with a simple select statement and then have PHP make the array look like this but I'm hoping this can be done with some kind of fancy db joining or something like that. Any takers?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >