Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

this is j query list view of Crud Oration and its works well but as par this ,he shows all records ,and i need only selected records so it need to add param to this query fromdate and todate ,just trying it meany time but cant understand how to pass date param ,

please help me to solve this one

What I have tried:

jquery

$(document).ready(function () {
        $('#JobTable').dataTable({
            "serverSide": true,
            "ajax": {
                "type": "POST",
                "url": "/NewJob/Getjob",
                "contentType": 'application/json; charset=utf-8',
                "datatype": "json",
                'data': function (data) { return data = JSON.stringify(data); },
                'data':'#JabDate',
                "render": function (data) {
                    var d = new Date(data);
                    return d.toLocaleString()
                },
                'fields': [{
                    label: 'Customer Name',
                    name: 'CustomerName'
                }, {
                    label: 'Shipper Name',
                    name: 'ShipperName'
                }, {
                    label: 'Job Noumber',
                    name: 'Job_no'
                }, {
                    label: 'job date ',
                    name: 'JabDate',
                    def: function () { return new Date(); },
                        format:  "{0:DD/mm/yyyy}",
                        fieldInfo: 'Verbose date format',
                        keyInput: false
                }, {
                    label: 'Job Type ',
                    name: 'JobType'
                }]
            },
            "columns": [
                { "data": "CustomerName", "orderable": true },
                { "data": "ShipperName", "orderable": true},
                { "data": "Job_no", "orderable": true},
                { "data": "JabDate", "orderable": true},
                { "data": "JobType", "orderable": true},
            ],
            "order": [[0, "asc"]]

        });
    });
Posted
Comments
ZurdoDev 4-Mar-19 9:09am    
You could add it to your url.
sayli1995 4-Mar-19 23:51pm    
thanks sir ,
i did like this and get result success
"url": "/Perchus/ListGetINV3?" + jQuery.param({ d1: $("#txtFromDate").val().trim(), d2: $("#txtToDate").val().trim() }),


but in crud list date is not shown as properly
Show entries
Search:
SypplyerName InvoiceNo InvoiceDate TaxAmount TotalAmount
Maxcover Logistic 4222 /Date(1550428200000)/ 865 5115
STAYwOOD sERVICES 4222 /Date(1549823400000)/ 50 1300

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900