1. I’ve been doing a lot of work with Sencha Touch 2.0 the last few weeks.  I gotta say that I love it!  Its a great cross-platform framework for mobile applications.  There is a bit of a learning curve in how it works, but its not too difficult. 

    It is HTML5/CSS3/Javascript so web developers (like me) can jump right in without being totally lost.  Granted it is using it’s own MVC framework utilizing mostly Javascript, so you’re going to have to learn how Sencha does things if you want to work with this framework.  

    I think I’ll write up a Sencha survival guide similar to Bryan’s Flex survival guide in the next few weeks.  I’ll put it up on WiBit.

     
  2. Building dynamic queries for tab switchers

    So my last post pointed out the problem with making dynamically switching content in drupal 7 with the dynamic queries.  Here is how you solve it:

    //Adding JQuery from the system to perform the voodoo!
    drupal_add_library('system', 'ui.tabs');
    drupal_add_js('jQuery(document).ready(function(){jQuery("#some-menu").tabs({ fx: { opacity: "toggle" }});});', 'inline');
    
    //Set the first query...or the query the first time
    $setExamplePrepare= db_select('example', 'a');
    $setExamplePrepare->leftJoin('example_joiner', 'b', 'a.nid= b.nid');
    $setExamplePrepare->fields('a',array('Title'))
    //I've changed the conditions and stuff..
    					->condition('a.somefield',$node->nid,'=')
    					->distinct()
    					->orderBy('b.vid');
    $example = $setExamplePrepare->execute();
    
    if ($example):
    		echo '
      '; foreach ($example as $e){ $setLiLabel= db_query('SELECT Table FROM example_joiner_two'. 'WHERE Title = :title', array(':title' => $d->title)); $someName= $setLiLabel->fetchColumn(); echo '
    • '.$someName.'
    • '; } echo '
    '; //Now we rinse, repeat $setExamplesPrepareAgain = db_select('example', 'a'); $setExamplesPrepareAgain->leftJoin('example_joiner', 'b', 'a.nid = b.nid'); $setExamplesPrepareAgain->fields('a',array('title')) ->fields('b',array('ExampleName')) ->condition('a.somefiled',$node->nid,'=') ->distinct() ->orderBy('b.vid'); $examplesAgain = $setExamplesPrepare->execute(); foreach ($examplesAgain as $anotherExample): //execute your code here
    Enhanced by Zemanta
     
  3. Just found an interesting problem w/D7 queries

    Image representing Drupal as depicted in Crunc...
    Image via CrunchBase

    So Drupal 7 dynamic queries…love them, and hate them.

    I just noticed that if you set execute the query, then use the results in a foreach you can’t reuse that result set in another foreach?!  So if you’re looking to make a menu for dynamic content on the page (like a JQuery UI tab switcher dealy…that’s what I’m doing) you evidently can’t use the same query to populate both the ul and the content of each div?  Lame.