Search Results

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

Page 1/1 | 1 

  • async tree jquery easy ui

    - by user765368
    I'm trying to create an Async Tree in jQuery Easy Ui. I understand the idea behind it, but will this work if my root node is not a node that is coming from the database or something (therefore, it does not have any id). My root node is some node that I define myself. How would I make an async tree in jquery easy ui to load a bunch of nodes as children of my root node (which, again has no id because it's not coming from the database. My children nodes are coming from the database though). I hope y'all understand what I'm trying to do here. Any help please

    Read the article

  • convert portion of code into a function php

    - by user765368
    This is probably very easy to do but for some reason I can't seem to figure this out. Let's say I have code like this: $elements = array('a', 'b', 'c', 'd'); $myValues = array( 'values' => array( 'a' => array( 'xx' => 3, 'yy' => '' ), 'b' => array( 'xx' => '', 'yy' => '' ), 'c' => array( 'xx' => 8.4, 'yy' => '' ), 'd' => array( 'xx' => 18.4, 'yy' => '' ) ) ); foreach($elements as $elem) { if($myValues['values'][$elem]['xx'] != '') { if($myValues['values'][$elem]['xx'] < 6) { $myValues['values'][$elem]['yy'] = 'less than 6'; } elseif($myValues['values'][$elem]['xx'] >= 6 && $myValues['values'][$elem]['xx'] < 15) { $myValues['values'][$elem]['yy'] = 'between 6 and 16'; } else { $myValues['values'][$elem]['yy'] = 'greater than 15'; } testFunc($myValues['values'][$elem]['xx']); // This is how I would call my function once I replace the code above } } As you can see here what I'm trying to do is to change the value of $myValues['values'][$elem]['yy'] based on some conditions. What I want to do is to replace the if elseif else section of codes by a function that performs the same action. I tried something like: function testFunc($xx) { if($xx < 6) { $yy = 'less than 6'; } elseif($xx >= 6 && $xx < 15) { $yy = 'between 6 and 16'; } else { $yy = 'greater than 15'; } return $yy; } But obviously this won't work because I'm not changing the value of $myValues['values'][$elem]['yy'] inside my function. NOTE I really want to pass ONLY the value of $myValues['values'][$elem]['xx'] inside my function and return the changed value of $myValues['values'][$elem]['yy']. Can anybody help me with this? Thanks in advance

    Read the article

1