ITKeyword,专注技术干货聚合推荐

注册 | 登录

解决javascript - Semantic UI: Access search component selected item

itPublisher 分享于

2020腾讯云双十一活动,全年最低!!!(领取3500元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1073

【阿里云】双十一活动,全年抄底价,限时3天!(老用户也有),
入口地址https://www.aliyun.com/1111/home

I'm having a problem using the search component.

What I want to do is being able to access the selected element data but it looks there are some timing issues and/or I'm doing things in the wrong way.

This is my code:

$('.ui.search.popup-project-changeCustomer').search(
{
    type : 'standard',
    source : $scope.customers,
    searchFields : [
        'title',
        'description'
    ],
    onSelect : function(event) {
        $scope.project.customer = event.target.value;
        $scope.changeCustomer(token);
        return 'default';
    }
});

The problem resides in the onSelect event and basically I can access the target.value but what I get is what the user typed in and not what the search component puts into the input.

What's the best practice to actually get the data (like title, description etc..) of the user selected element? I guess I'm doing something wrong here.

javascript semantic-ui
asked Jan 15 '15 at 11:16 siannone 2,595 9 32 63

 | 

1 Answers
1

解决方法

I know that this is probably not a complete answer but more informations can be found here: https://github.com/Semantic-Org/Semantic-UI/issues/1634

I asked the same questio and looks like this issue will be solved in 1.8.0.


answered Jan 22 '15 at 13:02 siannone 2,595 9 32 63

 | 


相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。