Results 1 to 2 of 2

Thread: Live Search, What is submitted to php?

  1. #1
    Sencha User parsbin's Avatar
    Join Date
    Feb 2011
    Location
    Iran, Alborz, Karaj
    Posts
    123

    Question Live Search, What is submitted to php?

    Hi
    i made a live search in extjs and a php file, which feedback the research results to extjs file.
    i`v attached js codes in bottom, but i want to know how i could send the searched characters to my php file for create true output.
    how can do this?

    PHP Code:


    Ext
    .onReady(function(){
        var 
    ds = new Ext.data.Store({
                
    url'output.php'
                
    ,
            
    reader: new Ext.data.JsonReader({
                
    root'topics',
                
    totalProperty'totalCount',
                
    id'post_id'
            
    }, [
                {
    name'title'mapping'topic_title'},
                {
    name'topicId'mapping'topic_id'},
                {
    name'author'mapping'author'},
                {
    name'lastPost'mapping'post_time'type'date'dateFormat'timestamp'},
                {
    name'excerpt'mapping'post_text'}
            ])
        });

        
    // Custom rendering Template
        
    var resultTpl = new Ext.XTemplate(
            
    '<tpl for="."><div class="search-item">',
                
    '<h3><span>{lastPost:date("M j, Y")}<br />by {author}</span>{title}</h3>',
                
    '{excerpt}',
            
    '</div></tpl>'
        
    );
        
        var 
    search = new Ext.form.ComboBox({
            
    storeds,
            
    displayField:'title',
            
    typeAheadfalse,
            
    minChars:3,
            
    loadingText'Searching...',
            
    width570,
            
    pageSize:10,
            
    hideTrigger:true,
            
    tplresultTpl,
            
    applyTo'search',
            
    itemSelector'div.search-item',
            
    onSelect: function(record){ // override default onSelect to do redirect
                
    window.location =
                    
    String.format('http://extjs.com/forum/showthread.php?t={0}&p={1}'record.data.topicIdrecord.id);
            }
        });
    }); 

  2. #2
    Sencha User parsbin's Avatar
    Join Date
    Feb 2011
    Location
    Iran, Alborz, Karaj
    Posts
    123

    Default

    i`v found answer.
    requests : start,limit and query

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •