2012-04-23 83 views
0

我的代码是这里的index.php中搜索的搜索功能我想在警予

Search: <?php echo CHtml::textField(
     'search', 
     '', 
     array(
      'style'=>'width:150px', 
      'placeholder'=>Yii::t('app', 'User name...'), 
      'onchange'=>'$.fn.yiiGridView.update("user-grid", { 
       data: { "Users[username]": $(this).val() 
        } 
      }); 
      return false;' 
     )); ?> 

其desinging enter image description here

其正常搜索用户名 现在我wnat来搜索本FIRST_NAME和LAST_NAME(相同)箱 plz帮助我该怎么办对于

感谢变化提前

回答

2
data: { "Users[username]": $(this).val() } 

应该成为

data: { "Users[username]": $(this).val(), "Users[first_name]": $(this).val(), "Users[last_name]": $(this).val() } 

,也许你应该添加ANDOR到您的查询