问题
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