Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82115

Unable to get value of the property 'oFeatures': object is null or undefined

$
0
0
Hello,

I'm trying to refresh a table after updating it on the codebehind and despite every change I do I keep getting this error.
The codebehind is doing its job, after I return the partialview, it populates the table but nothing happens because I still haven't figured out how to solve this error. Can you please help me?

JScript
        $(document).ready(function () {
            var oEntityTable = $('#entityTable').dataTable({
                "bFilter": false,
                "bInfo": false,
                "bJQueryUI": true,
                "bServerSide": true,
                "sAjaxSource": "SearchClients",
                "sDom": '<"top">rt<"bottom"flp><"clear">'
            });
        });

        $(document).ready(function () {
            $('#btnSearchClients').click(OnBtnSearchClientsClick);
        });

        function OnBtnSearchClientsClick(e) {
            $.ajax({
                url: jqDataUserUrl.Url,
                type: "POST",
                cache: false,
                success: function () {
                    $('#entityTable').dataTable().fnDraw();
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    //TODO
                }
            });

            return false;
        }

And in the codebehind I have something like this:

C#
        public ActionResult SearchClients(FormCollection oForm)
        {
            var entity = new Entity();
            entity.Results = new List<Entity>().ToArray();
            
            GetEntityListIn getEntityListIn = new GetEntityListIn();

            //(...)

            GetEntityListOut GetEntityListOut = client.GetEntityList(getEntityListIn);

            if (GetEntityListOut != null)
            {
                entity.Results = GetEntityListOut.Entity;
                ViewBag.Results = entity.Results;

                return PartialView("AddClient", entity);
            }

            return PartialView("AddClient");
        }

What am I doing wrong?

Viewing all articles
Browse latest Browse all 82115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>