jQWidgets Forums

Forum Replies Created

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts

  • dqninh09@gmail.com
    Participant

    Actually, the above script I copied and pasted it from the browser debug window, which could be confusing. In my code, it is actually much simpler. I am using VS MVC, so my code is written as follow:

    // In the Controller

    ViewBag.XmlData = “<TableName><Record id=\”1\” firstname=\”Joe1\” lastname=\”Smith\” telephone=\”1234567890\” /><Record id=\”2\” firstname=\”Joe2\” lastname=\”Smith\” telephone=\”1234567890\” /><Record id=\”3\” firstname=\”Joe3\” lastname=\”Smith\” telephone=\”1234567890\” /><Record id=\”4\” firstname=\”Joe4\” lastname=\”Smith\” telephone=\”1234567890\” /><Record id=\”5\” firstname=\”Joe5\” lastname=\”Smith\” telephone=\”1234567890\” /></TableName>”;
    return View();

    // And in the index.cshtm file, I simple set the ViewBag.XmlData to the localdata: as shown below

    // prepare the data
    var source =
    {
    datatype: “xml”,
    datafields: [………..],
    root: “TableName”,
    record: “Record”,
    id:”\\id”,
    localdata: @ViewBag.XmlData

    Blablabla….

    I tried to wrap @ViewBag.XmlData with double quotes, single quotes, but still get the error.

    Thanks.


    dqninh09@gmail.com
    Participant

    BTW, the problem is that somehow it does not understand the HTML code for the HTML reserved character and error out at the first “less than” <

    SCRIPT1002: Syntax error

    localdata: <TableName><Record id="1" firstname="Joe1" lastname="Smith" telephone="1234567890" /><Record id="2" firstname="Joe2" lastname="Smith" telephone="1234567890" /><Record id="3" firstname="Joe3" lastname="Smith" telephone="1234567890" /><Record id="4" firstname="Joe4" lastname="Smith" telephone="1234567890" /><Record id="5" firstname="Joe5" lastname="Smith" telephone="1234567890" /></TableName>

    Thanks


    dqninh09@gmail.com
    Participant

    Hi Peter,

    Do you have an example code of passing a XML string to the localdata: instead of using the url? All my stored procedure return a XML string (as shown below), and I simply want to set the XML string to localdata:

    <TableName>
    <Record id=”1″ firstname=”Joe1″ lastname=”Smith” telephone=”1234567890″ />
    <Record id=”2″ firstname=”Joe2″ lastname=”Smith” telephone=”1234567890″ />
    <Record id=”3″ firstname=”Joe3″ lastname=”Smith” telephone=”1234567890″ />
    <Record id=”4″ firstname=”Joe4″ lastname=”Smith” telephone=”1234567890″ />
    <Record id=”5″ firstname=”Joe5″ lastname=”Smith” telephone=”1234567890″ />
    </TableName>

    Thanks.


    dqninh09@gmail.com
    Participant

    Thanks Peter, that works like magic.

    in reply to: Jqxdatatable Jqxdatatable #48708

    dqninh09@gmail.com
    Participant

    Never mind. It’s my bad. Width: ‘100%’ works. I forgot to put the value between the quotes.

    Thanks.

    in reply to: Jqxdatatable Jqxdatatable #48707

    dqninh09@gmail.com
    Participant

    I set the width: 100% before (and just tried it again), and the data table failed to display due to an error. Can you give me the link to the demo that used 100%?

    Thanks.

    // This works
    $(“#dataTable”).jqxDataTable(
    {
    width: 1140,
    source: dataAdapter,
    …..

    // This failed
    $(“#dataTable”).jqxDataTable(
    {
    width: 100%,
    source: dataAdapter,

    in reply to: Jqxdatatable Jqxdatatable #48644

    dqninh09@gmail.com
    Participant

    Thanks Peter. It works. Simple but never thought about.

    How about the jqxDataTable itself. If I leave the width undefined, it does not fill the width of its parent.

Viewing 7 posts - 16 through 22 (of 22 total)