Chris

Forum Replies Created

Viewing 15 replies - 16 through 30 (of 32 total)
  • Author
    Replies
  • in reply to: Save & Load Grid State #124179
    Chris
    Participant

    Hmmm…  seems like an oversight to me as if the grid does not look the same as before then you are not saving state:-)  Also Excel and PDF are set via the same setNavOptions.

    Whilst you are looking at this can you recommend a neat way of adding this every time when being loaded from state – is there some javascript I can add that will put the excel export and PDF buttons back? Obviously the excel and pdf code is in the PHP file still to be executed when the Excel and PDF export are clicked?  We have the export excel on every grid and export to PDF on some, but happy to just have it on everything and make sure the PDF code is in all PHP.

    I have been waiting for the sticky feature for so long and you are so close to having a 100% finished feature – shame to not get it complete:-)

    Cheers, Chris.

     

     

     

     

    in reply to: Save & Load Grid State #124175
    Chris
    Participant

    OK – I found in the comments of the code that you have to tell it to save the navigation settings, so I have used the storeNavOptions=>true in the PHP file and now the Edit, Add, Delete, Refresh options to come back when I loadState.

    BUT – unless there is another setting required it is not reinstating the Export to Excel and Export to PDF for some weird reason.

    Help appreciated… feel like I am getting closer!

     

     

    in reply to: Save & Load Grid State #124173
    Chris
    Participant

    Hello Tony – this is all working perfectly now, but have found a couple of gremlins, one you have already said is an issue on another post where when you saveState and loadState it applies the filters, but does not populate the filter boxes with the filter values so you do not know as a users what filters have been applied where.

    But I have found another one with regard to the Navigation options set by:

    $grid->setNavOptions(‘navigator’, array(“excel”=>true,”pdf”=>true, “add”=>false,”edit”=>false,”del”=>false,”view”=>true,”cloneToTop”=>true));

    When you load the grid with no save state they appear perfectly, but soon as you saveState and then load you lose them all….

    I am really hoping it should be OK and I am doing something wrong, but after a few hours of trying I thought I would ask to stop beating myself up!

    Any help appreciated as I probably can live with the filters, but losing the option to Export to excel and PDF etc is not an option.

    Some background information:

     

    • This reply was modified 10 years, 8 months ago by Chris.
    in reply to: Save & Load Grid State #124156
    Chris
    Participant

    Thanks Tony. I am sure having a different name on each page for the grid will be useful as you develop this framework further, so probably best to bite the bullet now and come up with a scheme that will work. Initial thoughts are to use the page name as part of the grid name as only ever have one on a page.

    All good stuff though and very pleased with Version 5!

    in reply to: Save and Load filters not showing #124155
    Chris
    Participant

    Yes – sorry saveState and loadState is correct. Test case would be:

    1. Create a grid that has column/toolbar filters
    2. Use toolbar filter on a column and see the results
    3. Save the state of the grid
    4. Move away from the page and return
    5. Load state of the grid and notice the toolbar filter has been applied to the results, but you can not see the text used for the filter in the toolbar

    Does that help?

    Thanks for looking.

    in reply to: Save & Load Grid State #124145
    Chris
    Participant

    I have managed to get this working by handling it in jQuery/Javascript.  So on
    window.onload = function() {

    I have added the code:
    if (localStorage.getItem(“jqGridgrid”) != null) { // if saved grid details then use…
    $.jgrid.loadState(“grid”); // change to the name of your grid</p>
    }
    I also add this to the window.onload function  to save the state – I do it when a user leaves the page by adding
    $(window).bind(‘beforeunload’,function(){
    $.jgrid.saveState(“grid”); // Change to the name of the grid
    });
    I found that I had to check if the local storage exists before executing the loadState as it kept removing the grid – not sure why?
    Note the local storage gets named jqGridgrid and I assume the grid is the name of the grid.
    This actually works, but my problem is that on all my pages the the grid name is “grid” and so when you save for a grid on say analysis it tries the apply the saved data to the management grid.  I realise I need to change this so each grid on a page needs it own name, but if you have any smart ideas on how I could do this without the extra work that would be great!

    • This reply was modified 10 years, 9 months ago by Chris.
    in reply to: pager_left width is not set correctly #123749
    Chris
    Participant

    Hello – unfortunately I have tried that, but the pager is ignoring it and still moving to left and being overwritten by the pdf export etc.  I implemented by changing as follows:

     

    I can not use your latest version live as it messes up about 80% of my grids, so will probably wait not until this gets fixed.  I am happy of the latest Trirand release as long as my license does not give up!

     

     

    in reply to: Upgrading from Triband PHP to Guiddo – any docs? #123740
    Chris
    Participant

    I am sure I took that out when trying to identify the problem, but will definitely give it a try!

     

    Have a nice weekend.

    in reply to: pager_left width is not set correctly #123739
    Chris
    Participant

    Hello – Can you please point me in the right direction as to how I set pagerpos? I have tried to find in the docs, but cant find that parameter.

    Happy to try this until you fix it.

     

    As I said the latest Trirand release I use in live works perfectly with the exact same code I am using on your 4.8 release…

    Have a nice weekend.

     

    in reply to: pager_left width is not set correctly #123731
    Chris
    Participant

    Just for information this is old code that has been working perfectly on the last Trirand release that we use on our live systems…

    • This reply was modified 11 years ago by Chris.
    in reply to: Upgrading from Triband PHP to Guiddo – any docs? #123730
    Chris
    Participant

    Also just to add this is old code that worked fine on the latest Trirand release we are using live at the moment.

     

    in reply to: Upgrading from Triband PHP to Guiddo – any docs? #123729
    Chris
    Participant

    By the way not sure what goes wrong with the post system, but on the hold php code it never formats OK – if you can look at a text view it will look fine I think. This is the same code I posted successfully on the query about the paging being on the left rather than the centre…

     

    in reply to: Upgrading from Triband PHP to Guiddo – any docs? #123728
    Chris
    Participant

    Hello – well it was not working with every single grid of mine, but works fine with the 4.7 tcpdf library. If you want to ship me or send a link for the new tcpdf library – very happy to try. Here is a simple example though:

    in reply to: pager_left width is not set correctly #123726
    Chris
    Participant

    Here are two pictures – the first with the paging in the centre of the pager bottom bar and second with the paging to the left. The effect is the icons for pdf export overlap the paging buttons.  When you go to click on the PDF export you get the paging instead.  The reason for this is the td#pager_left html tag as a style added to it of style=”width: xxxpx”. When it is working OK there is no style added – so not sure what determines there the style width is added or not?

    Picture of wrong paging position

    Picture of correct paging position

    Here is very simple example code of the origin grid display that is not working properly…

    • This reply was modified 11 years ago by Chris.
    in reply to: pager_left width is not set correctly #123720
    Chris
    Participant

    I actually have this happening on my grids since upgrading to 4.8!  But although it is happening on some that have a hidden column it is happening on others that do not have a hidden column.

    Is there an answer to this?

     

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

Stay connected with us in your favorite flavor!