hello,
how would you use remote data and filter through those cards using data Manager?
export class RemoteData extends SampleBase {
constructor() {
super(...arguments);
this.dataManger = new DataManager({
url: 'https://js.syncfusion.com/ejServices/wcf/Northwind.svc/Tasks',
crossDomain: true
});
this.statusData = [
{ id: 'None', value: 'None' },
{ id: 'To Do', value: 'Open' },
{ id: 'In Progress', value: 'InProgress' },
{ id: 'Testing', value: 'Testing' },
{ id: 'Done', value: 'Close' }
];
this.value = 'None';
this.fields = { text: 'id', value: 'value' };
}
dialogOpen(args) {
args.cancel = false;
}
statusSelect(args) {
let filterQuery = new Query();
if (args.itemData.value !== 'None') {
filterQuery = new Query().where('Status', 'equal', args.itemData.value);
}
this.kanbanObj.query = filterQuery;
}
render() {
return (
<div className="kanban-control-section">
<div className="col-lg-12 control-section">
<div className="control-wrapper">
<KanbanComponent id="kanban"
ref={kanban =>
{
this.kanbanObj = kanban;
}}
keyField="Status"
dataSource={this.dataManger}
cardSettings={{ contentField: 'Summary', headerField: 'Id' }}
allowDragAndDrop={true}
dialogOpen={this.dialogOpen.bind(this)}
>
<ColumnsDirective>
<ColumnDirective headerText="To Do" keyField="Open" />
<ColumnDirective headerText="In Progress"
keyField="InProgress" />
<ColumnDirective headerText="Testing" keyField="Testing" />
<ColumnDirective headerText="Done" keyField="Close" />
</ColumnsDirective>
</KanbanComponent>
</div>
</div>
<div className="col-lg-3 property-section">
<div className="property-panel-section">
<p className="property-panel-header">Filtering</p>
<div className="property-panel-content">
<table className="e-filter-table">
<tr>
<td className="e-filter-label">
<div>Status</div>
</td>
<td>
<div>
<DropDownListComponent id="status_filter"
ref={kanban =>
{
this.statusObj = kanban;
}}
dataSource={this.statusData}
select={this.statusSelect.bind(this)}
value={this.value}
fields={this.fields}
placeholder="Select a status"
/>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
);
}
}
render(
<RemoteData />, document.getElementById('sample'));
|
hi
Thank you for getting back to me.
I'm using a SQL and pulling the data through a localhost server server. The code above works perfectly when using your URL but when I enter mine it doesn't. Any idea why? Could it be my SQL query?
public JsonResult LoadData(Params param) // Here we can filter the cards using where query.
{
var data = db.ScheduleEventDatas.ToList();
var model = from r in db.ScheduleEventDatas orderby r.Subject where r.Subject == "Inprogress" select r;
return Json(model);
//return Json(data, JsonRequestBehavior.AllowGet);
} |