So I have a store that loads data for calendar events and a view model.The problem is that I have an admin panel and user interface and I want users to see only events that are upcoming, but keep older events in the database. So I have this right now:
columns: [{
header: 'Date of event',
width: 125,
dataIndex: 'event_time',
renderer: this._renderExactDate,
field: {
type: 'textfield'
}
}
and I have this function
_renderExactDate: function(date) {
var currentDate = new Date()
var value = date;
value = Ext.Date.parse(value,"Y-m-d H:i:s");
if (currentDate < value) {
return //something;
}
else {
return //something;
}
}
which successfully check if the date is older than the current date but when the check is done I don’t know how to prevent the whole column to be rendered in order to present a grid with only upcoming events
thanks
Leron
You can just filter the store which attached to your grid to show only event that are in the future. Don’t need to change
renderer()function. Or I didn’t understand your question?Update:
After you load the store do the following: