Mark

Forum Replies Created

Viewing 15 replies - 16 through 30 (of 104 total)
  • Author
    Replies
  • in reply to: scrolling giving error on page #91345
    Mark
    Participant

    Actually firebug didnt complain about the xml – it just reported essentially the same error you saw (deep inside the compressed jquery source) – which was basically an attempt to access a node in a null xml document.

    The error message (and url) was in the standard firefox error console (Tools|Error console). Usually everything listed there (and much more) also appears in the firebug console – but occaisionally it picks up something that firebug doesnt. Its always worth taking a look when things arent working…

    Mark

    in reply to: Save state #91343
    Mark
    Participant

    lou said:

    I tried this out but seem to be missing a step. For the line:

    $(’#mygrid’).jqGrid(cookie_here);

    is there anything I need to do when retrieving the values from the cookie? I get “[object Object]” returned and the grid doesn’t load.


    One missing step is that you need to serialize the grid parameters before putting them in the cookie, and then deserialize when you get the cookie back. JSON woul d be a good choice (or base-64 encoded json).

    But trying to save the entire param structure isnt going to work very well. Are you going to save your callbacks in the cookie? Its doable, but probably not what you want – if you fix a bug in the callbacks on your website, anyone who has the old ones saved in a cookie will still get the buggy versions. Even excluding functions – what if you change your colModel? You wouldnt want the whole thing saved away in your cookie…

    So its probably better to pick and choose the values you want to save. Eg you may want to save the column order, column visibility, column widths, sort column, sort order etc. Particularly since cookies are limited to 4k – and on IE6 there is a limit of 4k for all cookies belonging to a page.

    Mark

    in reply to: scrolling giving error on page #91341
    Mark
    Participant

    Firefox is reporting that the xml from this request is not well formed:

    http://www.courtnell.com/demo1/nexusdata.asp?_search=false&nd=1260369889483&rows=22&page=834&sidx=index1&sord=asc

    I dont think it likes the raw “&” in the data.

    Mark

    in reply to: Sort Types #91331
    Mark
    Participant

    If you have 200000 records, the “local” approach isnt going to work (even 10,000 would be a stretch).

    So I think you'll have to send the sort-type to the host, and sort there…

    Mark

    in reply to: Sort Types #91318
    Mark
    Participant

    Hi Mark,

    I think your problem is on the server side. sorttype only applies to local sorting, and I dont think you're using that (you /could/, by fetching all the data, and then switching to datatype: “local”, but you didnt mention that).

    So you need to look at your sort code on the server. I think what you need is to add the datatype to postdata in a beforeRequest handler.

    Basically, in your beforeRequest handler, look up the sorttype for the sort column, and add that to postdata (any name you like), and then modify you SQL to sort according to that…

    Mark

    in reply to: sortable columns #91311
    Mark
    Participant

    There are a couple of ways to hook into the sortable columns feature. First, rather than just setting the sortable option to true, you need to set it to an object with your options:

    $(“#mygrid”).jqGrid({

    in reply to: Lightbox integration #91285
    Mark
    Participant

    I think the problem is that lightbox scans the page when it initializes, and modifies any links with the “lightbox” class (presumably adding a click handler). But it doesnt dynamically alter links that are created later.

    Im not familiar with lightbox, but I would guess that it has a way of modifying a dynamically created link. Presumably there is a method you can call on the link (or a handler you can add manually).

    So you would need your own formatter, which calls the grid's link formatter, and then does whatever lightbox needs you to do.

    Mark

    in reply to: Auto suggest #91284
    Mark
    Participant

    Except that afterShowForm gets called each time the form is shown (!). Which would mean that you invoke autocomplete again each time the form is shown.

    You can get around that by setting “recreateForm:true”, or you could use onInitializeForm, which only gets called once.

    Mark

    in reply to: theme switcher plugin + jqgrid in a whole site #91152
    Mark
    Participant

    Looks like you need to load the themeswitcher javascript in each page, and call the themeswitcher() method on an element of the page in order to trigger the reload of the theme.

    You can always hide the element if you only want the switcher button to appear on the main page.

    Mark

    in reply to: unformatter for SEARCH filter #91151
    Mark
    Participant

    You can use beforeRequest to do anything you like with the posted search data.

    Mark

    Mark
    Participant

    Well, yes – buts its rather drastic…

    Now you're not allowing the user to reorder the columns at all, so you're just using the column chooser to show/hide columns. You could actually drop the remapColumns call altogether…

    Mark

    in reply to: jqgrid and the ajax_upload plugin #91104
    Mark
    Participant

    I think you're going to have to turn it around, and post the grid data via ajaxfileupload.

    So in your beforeSubmit function, you're going to have to copy the postdata to the file upload plugin, and the submit that.

    Not sure which file uploader you're using. I've used the one from http://valums.com/ajax-upload/. With that you would just do:

    uploader.setData(postdata);

    uploader.submit();

    But then you would need to prevent the grid from submitting your request too… there doesnt seem to be an easy way to do that. But you /could/ return [false, “OK”] from beforeSubmit. The problem with that is that the grid would put “OK” into the error field – so you would need to hide the error field immediately.

    I think you could do that with a setTimeout at the end of your beforeSubmit.

    so (untested, but probably close):

    beforeSubmit : function(postdata,form) {

    in reply to: auto search + true scroll+LIMIT range #91103
    Mark
    Participant

    Hi Marc,

    Yes, I understand the issue. It's comes up in a few places…

    reloadGrid can now take an optional options object. One of the options is “page”, which lets you specify the new page number after reload. I think if you set it to 1, you'll get the results you're after.

    The only other option is “current”, which preserves as much of the selection as it can (ie any rows which were selected before the reload, and are present after the reload, will be selected). Not relevant to the problem in hand, but I thought I'd mention it.

    To pass options to a jQuery event handler, you have to wrap it in an array in the trigger call, resulting in the rather odd looking:

    $(mygrid).trigger("reloadGrid", [{page:1}]);

    Mark

    Mark
    Participant

    You can pass in your own “done” function (in the columnChooser options). The done function is passed the permutation to be applied (or null if the user cancelled the columnChooser).

    The default function is:

    "done" : function(perm) { if (perm) this.jqGrid("remapColumns", perm, true) }

    You would need to modify the permutation to keep your columns where you want them, before calling remapColumns.

    The permuation array is such that the column that is currently in position permutation will move to position i.

    Mark

    in reply to: columnChooser – allow to select only several columns #91048
    Mark
    Participant

    The column chooser respects the hidedlg option in colModel. Just set it for the columns you dont want to appear in the chooser.

    Mark

Viewing 15 replies - 16 through 30 (of 104 total)

Stay connected with us in your favorite flavor!