constructor() {
super(...arguments);
this.data = [{ demandaid: "1", descricao: "Cardioversor", numdemanda: "00003-3", marca: "Philips", modelo: "Cardio", numserie: "5489", tag: "668" },
{ demandaid : "2", descricao : "Incubadora", numdemanda : "00005-3", marca : "Siemens", modelo : "AA220", numserie : "162A" }];
// maps the appropriate column to fields property
this.fields = { text: 'descricao', value: 'demandaid' };
}
//set the value to header template
//set the value to item template
itemTemplate(data) {
return (<span><span className='colunacombobox'>{data.numdemanda}</span><span className='colunacombobox2'>{data.descricao}</span><span className='colunacombobox2'>{data.marca}</span><span className='colunacombobox2'>{data.modelo}</span><span className='colunacombobox2'>{data.numserie}</span><span className='colunacombobox2'>{data.tag}</span></span>);
}
render() {
return (<div className='control-pane'>
<div className='control-section'>
<div id='template'>
<ComboBoxComponent id="employees" dataSource={this.data} fields={this.fields} placeholder="Select an employee" itemTemplate={this.itemTemplate} popupHeight="270px" />
</div>
</div>
</div>);
}
} |
this.onFiltering = (e) => {
if (e.text!="") {
var predicate = new Predicate('descricao', 'contains', e.text, true);
predicate = predicate.or('marca', 'contains', e.text,true);
predicate = predicate.or('numdemanda', 'contains', e.text,true);
predicate = predicate.or('modelo', 'contains', e.text,true);
predicate = predicate.or('numserie', 'contains', e.text,true);
predicate = predicate.or('tag', 'contains', e.text,true);
let query = new Query();
//frame the query based on search string with filter type.
query = (e.text !== '' && e.value !== '') ? query.where(predicate) : query;
//pass the filter data source, filter query to updateData method.
e.updateData(this.data, query);
}
};
render() {
return (<div className='control-pane'>
<div className='control-section'>
<div id='template'>
<ComboBoxComponent id="employees" dataSource={this.data} fields={this.fields} placeholder="Select an employee" itemTemplate={this.itemTemplate} filtering={this.onFiltering.bind(this)} allowFiltering={true} popupHeight="270px" />
</div>
</div>
</div>);
}
|
itemTemplate(data) {
return (
<table><tbody><tr><td class="e-text-center">{data.numdemanda}</td><td>{data.descricao}</td><td>{data.marca}</td> <td>{data.modelo}</td><td>{data.numserie}</td><td>{data.tag}</td></tr> </tbody></table>);
}
render() {
return (<div className='control-pane' >
<div className='control-section'>
<div id='template'>
<ComboBoxComponent id="employees" cssClass="e-multi-column" dataSource={this.data} fields={this.fields} placeholder="Select an employee" itemTemplate={this.itemTemplate} filtering={this.onFiltering.bind(this)} allowFiltering={true} popupHeight="270px"/>
</div>
</div>
</div>);
} |
.e-multi-column.e-ddl.e-popup.e-popup-open td {
border: 1px solid rgba(0, 0, 0, 0.125);
} |