0
我在我的jTable中的過濾器輸入中添加了jquery datepicker,但是當我設置startDate和endDate時,它返回0結果。即使我手動輸入日期仍然返回0記錄。無法從日期選擇器中的日期選擇器中獲取日期
這裏是我的view.php
<form class="searchbox_1">
Date from <input class="search_1" type="text" name="from_date" id="from_date"/>
Date to <input class="search_1" type="text" name="to_date" id="to_date"/>
<center><button class="submit_1" type="submit" id="LoadRecordsButton">Search</button>
<input class ="submit_1" type="reset" value="Clear fields!"></center>
</form>
</div>
<div id="countryTable"></div>
<script type="text/javascript">
$(document).ready(function() {
//Prepare jTable
$('#countryTable').jtable({
title: 'Country\'s',
paging: true,
pageSize: 10,
sorting: true,
defaultSorting: 'country_name ASC',
selecting: true,
multiselect: true,
selectingCheckboxes: true,
selectOnRowClick: true,
actions: {
listAction: 'bla',
createAction: 'bla1',
updateAction: 'bla2',
deleteAction: 'lba1'
},
fields: {
record_date: { title: 'Record Date',
type: 'date',
displayFormat: 'mm/dd/yy',
create: false,
edit: false,
sorting: false
}
},
$('#from_date').datepicker({
onSelect: function(dateText, inst){
$('#to_date').datepicker('option', 'minDate', new Date(dateText));
}
});
$('#to_date').datepicker({
onSelect: function(dateText, inst){
$('#from_date').datepicker('option', 'maxDate', new Date(dateText));
}
});
$('#LoadRecordsButton').click(function (e) {
e.preventDefault();
$('#countryTable').jtable('load', {
),
from_date: $('#from_date').val(),
to_date: $('#to_date').val()
});
});
$('#LoadRecordsButton').click();
});
</script>
我用笨,如果您需要任何其他信息,請讓我知道。