Reputation: 1997
my code is here for searching in 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;'
)); ?>
Its desinging
Its properly searching username now i wnat to search first_name and last_name in this(same)box plz help me what to do changes for that
thanks in advance
Upvotes: 0
Views: 1151
Reputation: 3186
data: { "Users[username]": $(this).val() }
should become
data: { "Users[username]": $(this).val(), "Users[first_name]": $(this).val(), "Users[last_name]": $(this).val() }
and maybe you should add AND
or OR
to your query
Upvotes: 2