简体   繁体   中英

GROCERY CRUD date picker widget?

It is given that if your column type is date the form will show a date picker using the grocery crud. My problem is that, is it possible to use the date picker widget of the GROCERY CRUD (like displaying the date picker in the view and return the picked date)? If yes, how? An example will be appreciated.

It uses the jQuery UI DatePicker .

So, assuming you have all of the same stylesheets and scripts included, in the view you want to use it on, as you do in the CRUD view, you can just use code like this (let's say your input field's id attribute is equal to "element"):

$("#element").datepicker();

Or, you can add a class to all of the elements you want to have date pickers (let's say date-picker ), and then run this JavaScript/jQuery:

$(document).ready(function(){
    $('.date-picker').datepicker();
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM