Hi folks,
I’m having a little problem here …
I created two inputText calendar type to use the filter in my grid.
var calenddd =
“”+
“”;
How do I filter by date range?
mygrid.init();
mygrid.loadXML(“xml/grid3.xml”, function(){
mygrid.attachHeader("#text_filter,#rspan,#rspan,#rspan,#rspan,#rspan,#rspan,"+calenddd);
//set title filter field
var cal1, cal2
var dateFrom = null;
var dateTo = null;
cal1 = new dhtmlxCalendarObject(‘calend1’, false, {isYearEditable: true});
cal1.attachEvent(“onClick”,mSelectDate1);
cal1.draw();
cal1.setSkin(“yahoolike”);
cal1.setDateFormat("%d/%m/%Y");
cal2 = new dhtmlxCalendarObject(‘calend2’, false, {isYearEditable: true});
cal2.attachEvent(“onClick”,mSelectDate2);
cal2.draw();
cal2.setSkin(“yahoolike”);
cal2.setDateFormat("%d/%m/%Y");
function mSelectDate1(date) {
dateFrom = cal1.getFormatedDate("%d/%m/%Y", date);
cal1.setSensitive(cal1.getFormatedDate("%d/%m/%Y", date),null)
mygrid.filterBy(7,???);
return true;
}
function mSelectDate2(date) {
dateTo = cal2.getFormatedDate("%d/%m/%Y", date);
alert(dateTo);
mygrid.filterBy(7,???);
return true;
}
});
Waiting in the wings,
FelipeTv.
Hello,
the possible solution is
cal1.attachEvent(“onClick”,mSelectDate);
cal2.attachEvent(“onClick”,mSelectDate);
function mSelectDate(date) {
dateFrom = cal1.getFormatedDate("%d/%m/%Y", date);
dateTo = cal2.getFormatedDate("%d/%m/%Y", date);
cal1.setSensitive(cal1.getFormatedDate("%d/%m/%Y", date),null)
mygrid.filterBy(7,function(val){
return ((val<dateFrom)&&(val>dateTo));
});
return true;
}
Please take see the article dhtmlx.com/dhxdocs/doku.php? … :filtering for more details
Thank you very much.
I did not know the true value filtered grid
My solution was to merge his idea with mine.
my column id = 7 is the last.
The Calendar (cal1.draw() or cal2.draw()) does not appear on the screen as shown on the link below:
ww1.dlbca.com.br/fdata/cal.jpg
The setPosition not work.
Do you have any solution to this problem?
Solution:
The setPosition method also allows to set the exact position of the calendar:
calendar.setPosition(Y,X);