Error on serializing Object that contains Collection

Error on serializing Object that contains Collection

theConartisttheConartist Posts: 14Questions: 3Answers: 0

Previously, DataTablesResult.Create could handle objects that contains IEnumerable members but now when I execute Create, members now looks like this, Data.aaData[0][0] contains "System.Collections.Generic.List`1[System.String]" as string instead of the collection

Answers

  • theConartisttheConartist Posts: 14Questions: 3Answers: 0

    you have a problem in your transformation in this line. result.Data = result.Data.Transform<Dictionary<string, object>, Dictionary<string, object>>(StringTransformers.TransformDictionary);

  • theConartisttheConartist Posts: 14Questions: 3Answers: 0

    Does datatables handle records with rows that have collections? and do the search feature work on the collection?

  • allanallan Posts: 62,858Questions: 1Answers: 10,344 Site admin

    Collections are a .NET concept as far as I am awesome. DataTables (this Javascript library) expects a DOM or JSON data source.

    Allan

  • theConartisttheConartist Posts: 14Questions: 3Answers: 0

    The concern is on the DataTablesResult class.

  • allanallan Posts: 62,858Questions: 1Answers: 10,344 Site admin

    The DataTables Javascript library doesn't obtain such a class. What is DataTablesResult? Is it a server-side class (I presume so)? If so, I'd suggest you contact the author of that software.

    Allan

  • theConartisttheConartist Posts: 14Questions: 3Answers: 0

    https://github.com/johannes-brunner/DataTables-ASP.NET-MVC
    so this author is a separate party from yours?

  • allanallan Posts: 62,858Questions: 1Answers: 10,344 Site admin

    Yup - I've not come across that library before. Look alike it might be using the old 1.9 style of server-side processing.

    Allan

This discussion has been closed.