Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorsuthern
    • CommentTimeMar 10th 2008 edited
     

    Howdy! While going through demos on www.script.aculo.us I ran across the auto_complete series. The simple one at http://demo.script.aculo.us/ajax/autocompleter looked interesting, so I thought I'd see if akelos supported it.

    Upon searching through the akelos code, ( source: javascript_macro_helper.php line:221) I found I could put something like

    <?= $javascript_macros_helper->text_field_with_auto_complete('spot','loc_code') ?>
    

    In my view.tpl (which renders a nice text box). The same location in the _helper file said I needed to put "auto_complete_for_object_method" in the controller to handle the ajax calls. Is there anywhere I can find more details on this? What kind of augments are provided to the function auto_complete_for_spot_find_spot(??), and what exactly do I need to return? a render_partial for each row? Thanks for any tips!

    • CommentAuthorsuthern
    • CommentTimeMar 12th 2008
     

    And if I would have read the javascript_macro_helper a little better, I would have seen this example only a few lines above it. Posted here for completeness sake.

      function auto_complete_for_item_title()
      {
        $this->items = $Item->find('all', array('conditions' => array('strtolower($description).' LIKE ?', '%' . strtolower($this->_controller->Request->getRawPostData(). '%' ))))
        return $this->_controller->render(array('inline'=> '<?= $javascript_macros->auto_complete_result(@$items, 'description') ?>'));
      }
    
    • CommentAuthorVBharathi
    • CommentTimeMar 13th 2008
     
    Hi,
    I dont understand this akelos .So i want the one example program with using all kind of features.
    •  
      CommentAuthorbermi
    • CommentTimeMar 13th 2008
     

    @VBharathi, you should not be repeating the same off-topic questions on every single thread of this forum.

    @suthern To tell the truth I've never used the script.aculo.us and JavaScript macros helpers as I trend to code using css selectors and attaching behaviors via JavaScript... I will give it a try now that we have erb syntax in Sintags :)

    Salavert ported this feature to Akelos, so he might be the able to help you on this one.

    Meanwhile I'll submit a ticket for adding proper unit tests for this functionality.

    • CommentAuthorsuthern
    • CommentTimeMar 14th 2008
     

    Thanks Bermi.

    I haven't got ajax working yet, but be assured that when I do get it working I'll update the thread. ;-)

Add your comments
    Username Password
  • Format comments as