Categories | Question details Back To List | ||
Filtering Grid with setSensitive Hi folks, I'm having a little problem here ... I created two inputText calendar type to use the filter in my grid. var calenddd = "<input id='calend1' name='calend1' readonly='readonly' type='text' />"+ "<input id='calend2' name='calend2' readonly='readonly' type='text' />"; 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. Answer posted by Alex (support) on Oct 14, 2009 04:39 Hello, the possible solution is cal1.attachEvent("onClick",mSelectDate); Answer posted on Oct 14, 2009 08:05 Thank you very much. I did not know the true value filtered grid Solution: cal1 = new dhtmlxCalendarObject('calend1', false, {isMonthEditable: true, isYearEditable: true}); cal2 = new dhtmlxCalendarObject('calend2', false, {isMonthEditable: true, isYearEditable: true}); Answer posted by Alex (support) on Oct 15, 2009 02:23 The setPosition method also allows to set the exact position of the calendar: calendar.setPosition(Y,X); |