Click here to Skip to main content
15,898,538 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: I keep getting error $(...).fileupload is not a function. Pin
KGr2830-Jul-19 9:12
KGr2830-Jul-19 9:12 
GeneralRe: I keep getting error $(...).fileupload is not a function. Pin
Afzaal Ahmad Zeeshan30-Jul-19 12:28
professionalAfzaal Ahmad Zeeshan30-Jul-19 12:28 
GeneralRe: I keep getting error $(...).fileupload is not a function. Pin
KGr2831-Jul-19 3:38
KGr2831-Jul-19 3:38 
GeneralRe: I keep getting error $(...).fileupload is not a function. Pin
Afzaal Ahmad Zeeshan31-Jul-19 8:17
professionalAfzaal Ahmad Zeeshan31-Jul-19 8:17 
GeneralRe: I keep getting error $(...).fileupload is not a function. Pin
KGr2831-Jul-19 8:19
KGr2831-Jul-19 8:19 
QuestionHow to generate complex Multi-Color-Gradients with PHP? Pin
Member 1453705321-Jul-19 8:23
Member 1453705321-Jul-19 8:23 
AnswerRe: How to generate complex Multi-Color-Gradients with PHP? Pin
Richard MacCutchan21-Jul-19 21:13
mveRichard MacCutchan21-Jul-19 21:13 
QuestionWhen trying to reload DataTable I get error:Uncaught TypeError: Cannot set property 'data' of null Pin
KGr289-Jul-19 4:49
KGr289-Jul-19 4:49 
I want to be able to reload my Datatable once my checkbox is clicked , provided below is my attempted code but I continue to get error:Uncaught TypeError: Cannot set property 'data' of null not really sure how to handle this error. I have provided both the javascript and the view in my MVC application please let me know if you need more details.


.js
function ReloadTable()
{


    $(document).ready(function () {
        var table =  $('#DashboardTable').DataTable({

            "processing": true, // for show progress bar
            "serverSide": true, // for process server side
            "filter": true, // this is for disable filter (search box)
            "orderMulti": false, // for disable multiple column at once
            //"pageLength": 5,
        

            "ajax": {
                "url": "/Chargeback/Index",
                "type": "GET",
                "datatype": "json"
            },
            "columns": [
            { "data": "ChargebackCode" },
            { "data": "StatusName" },
            { "data": "BusinessUnitName" },
            { "data": "InvoiceCode" },
            { "data": "OrderCode" },
            { "data": "PickTicketCode" },
            { "data": "CustomerPo" },
            { "data": "AssignedDepartment" },
            { "data": "DivisionName" },
            { "data": "Customer" },
            { "data": "WarehouseName" },
            { "data": "Coordinator" },
            { "data": "ChargebackDate" },
            { "data": "ModDate" },
            { "data": "ChargebackDeadline" },
            { "data": "ChargebackCloseDate" },
            { "data": " DaysOpen" },
            { "data": "ChargebackAmount" },
            { "data": "ChargebackBalance" },
            { "data": "FaultName" },
            { "data": "ResponsibleName" }
            ]

        });
        table.ajax.reload();
    });

}






View

@using (Html.BeginForm("Index", "Chargeback"))
{
   <label id = "Include" > @Html.CheckBox("IncludeClosed", (bool)ViewBag.IncludeClosed, new { onChange = "ReloadTable()" }) Include Closed</label>

<table id="DashboardTable" class="table table-striped" >
    <thead>
        <tr>
            <th>Code</th>
            <th>Status</th>
            <th>Business</th>
            <th>Invoice</th>
            <th>Order</th>
            <th>Pick Tickets</th>
            <th>Customer PO</th>
            <th>Assigned</th>
            <th>Division</th>
            <th>Customer</th>
            <th>Warehouse</th>
            <th>Coordinator</th>
            <th>Open Date</th>
            <th>Last Activity</th>
            <th>Deadline</th>
            <th>Closed Date</th>
            <th>Days Open</th>
            <th>Amount</th>
            <th>Balance</th>
            <th>Fault</th>
            <th>Responsible</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            var chargebackDeadline = item.ChargebackDeadline == null ? "" : ((DateTime)item.ChargebackDeadline).ToString("MM/dd/yyyy");
            var chargebackCloseDateAsString = item.ChargebackCloseDate == null ? "" : ((DateTime)item.ChargebackCloseDate).ToString("MM/dd/yyyy");

            <tr>
                <td>@Html.ActionLink(item.ChargebackCode, "Details", "Chargeback", new { id = item.Id }, null)</td>
                <td>@item.StatusName</td>
                <td>@item.BusinessUnitName</td>
                <td>@item.InvoiceCode</td>
                <td>@item.OrderCode</td>
                <td>@item.PickTicketCode</td>
                <td>@item.CustomerPo</td>
                <td>@item.AssignedDepartment</td>
                <td>@item.DivisionName</td>
                <td>@item.Customer</td>
                <td>@item.WarehouseName</td>
                <td>@item.Coordinator</td>
                <td>@item.ChargebackDate.ToString("MM/dd/yyyy")</td>
                <td>@item.ModDate.ToString("MM/dd/yyyy")</td>
                <td>@chargebackDeadline</td>
                <td>@chargebackCloseDateAsString</td>
                <td>@item.DaysOpen</td>
                <td>$@item.ChargebackAmount</td>
                <td>$@item.ChargebackBalance</td>
                <td>@item.FaultName</td>
                <td>@item.ResponsibleName</td>
            </tr>
        }
    </tbody>
</table>
}

AnswerRe: When trying to reload DataTable I get error:Uncaught TypeError: Cannot set property 'data' of null Pin
Afzaal Ahmad Zeeshan30-Jul-19 8:59
professionalAfzaal Ahmad Zeeshan30-Jul-19 8:59 
QuestionPerforming Ajax on dataTable where checkbox is clicked Pin
KGr288-Jul-19 7:54
KGr288-Jul-19 7:54 
AnswerRe: Performing Ajax on dataTable where checkbox is clicked Pin
ZurdoDev8-Jul-19 8:06
professionalZurdoDev8-Jul-19 8:06 
GeneralRe: Performing Ajax on dataTable where checkbox is clicked Pin
KGr288-Jul-19 8:09
KGr288-Jul-19 8:09 
GeneralRe: Performing Ajax on dataTable where checkbox is clicked Pin
KGr288-Jul-19 8:58
KGr288-Jul-19 8:58 
GeneralRe: Performing Ajax on dataTable where checkbox is clicked Pin
ZurdoDev8-Jul-19 9:07
professionalZurdoDev8-Jul-19 9:07 
GeneralRe: Performing Ajax on dataTable where checkbox is clicked Pin
KGr288-Jul-19 9:28
KGr288-Jul-19 9:28 
AnswerRe: Performing Ajax on dataTable where checkbox is clicked Pin
ZurdoDev8-Jul-19 9:40
professionalZurdoDev8-Jul-19 9:40 
GeneralRe: Performing Ajax on dataTable where checkbox is clicked Pin
KGr288-Jul-19 9:48
KGr288-Jul-19 9:48 
GeneralRe: Performing Ajax on dataTable where checkbox is clicked Pin
ZurdoDev8-Jul-19 9:50
professionalZurdoDev8-Jul-19 9:50 
GeneralRe: Performing Ajax on dataTable where checkbox is clicked Pin
KGr288-Jul-19 10:34
KGr288-Jul-19 10:34 
QuestionDeply Web API to IIS Pin
Kevin Marois2-Jul-19 4:22
professionalKevin Marois2-Jul-19 4:22 
AnswerRe: Deply Web API to IIS Pin
F-ES Sitecore2-Jul-19 4:52
professionalF-ES Sitecore2-Jul-19 4:52 
GeneralRe: Deply Web API to IIS Pin
Kevin Marois2-Jul-19 5:04
professionalKevin Marois2-Jul-19 5:04 
AnswerRe: Deply Web API to IIS Pin
ZurdoDev2-Jul-19 10:28
professionalZurdoDev2-Jul-19 10:28 
GeneralRe: Deply Web API to IIS Pin
Kevin Marois2-Jul-19 10:39
professionalKevin Marois2-Jul-19 10:39 
QuestionHelper Methods MVC Pin
KGr2825-Jun-19 7:52
KGr2825-Jun-19 7:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.