How to apply placeholder to Google Visualization control wrapper string filter input?

一笑奈何 提交于 2020-01-03 04:30:34

问题


I have to apply placeholder to Google Visualization control wrapper string filter input.I tried with

var stringFilter = new google.visualization.ControlWrapper({
      'controlType': 'StringFilter',
      'containerId': 'search_container',
      'options': {
        'filterColumnLabel': 'Name',
        'matchType':'any',
        'ui': {'label': ''}
       }
});

google.visualization.events.addListener(stringFilter, 'ready', function(){
   $(".google-visualization-controls-stringfilter").prop('placeholder', "Search..");
});

but it does not work.


回答1:


You need to select the <input> that is inside the div with the class .google-visualization-controls-stringfilter:

google.visualization.events.addListener(stringFilter, 'ready', function () {
    $('.google-visualization-controls-stringfilter input').prop('placeholder', 'Search...');
});


来源:https://stackoverflow.com/questions/23384260/how-to-apply-placeholder-to-google-visualization-control-wrapper-string-filter-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!