beckdawg83

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • in reply to: Is export bugged or am I just doing something wrong? #98822
    beckdawg83
    Participant

    To follow up, I managed to get it working slightly by posting this into my controller instead of the export.

    '{“grid”: ' + JSON.stringify($('#grid').jqGrid(“getGridParam”)) + '}';

    However, this appears to break subgrids. I get a second subgrid column header and other stuff. That being said, it makes me believe the issue is that the export is posting in something that's not invalid. I tried a bunch of things to get this working so I might mistake something here but I believe I tried xml instead and it included \n characters. So, it's highly likely that it's not stripping the data correctly for whatever reason. What I was doing was posting it into a spring controller as a string using jackson to marshall. So, it's possible that some where there its encoding got screwed up too. I didn't want to have to build an object to map it to since I was never going to be altering that data on the back end. Also, I noticed when I had a subgrid it wasn't posting in a valid json. The function javascript wasn't playing nice with things.

    Either way, I feel like this area of the documentation could use a lot of love. A working example would be great.

    in reply to: jqGridExport+GridUnload+jqGridImport=no data #98818
    beckdawg83
    Participant

    I suspect you have a similar problem to what I do(see: http://www.trirand.com/blog/?page_id=393/discussion/is-export-bugged-or-am-i-just-doing-something-wrong/&value=export&type=1&include=1&search=1&ret=all). Well first of all, I'm not sure import works like you are trying to do. I tried to something similar. On page entry I wanted to check to see if the user had a saved configuration so I did an ajax call which returns the json of the grid config if there was one. I then tried to load data like you're doing but it didn't work for me at all.

    To see if it's even running correctly for you what you can do is this

    grid.jqGrid('GridUnload').jqGrid('jqGridImport',{imptype:”jsonstring”, impstring:savedata,importComplete: function() {alert('something');}});

    That importComplete runs when the grid loads. In my case it would never run without having the mtype and impurl in it. So, i just made a second call to my controller. After I fixed that I noticed some issues with export. I'm not sure why but when I export my grid it gives way more stuff in the json than I supply and that causes the import to break. If I manually roll my own json file I was able to make it work. By that I mean do something like this

    '{“grid”:{' +

Viewing 2 replies - 1 through 2 (of 2 total)

Stay connected with us in your favorite flavor!