trevrobwhite

Forum Replies Created

Viewing 15 replies - 1 through 15 (of 29 total)
  • Author
    Replies
  • in reply to: Horizontal Scrollbar Always Display #126180
    trevrobwhite
    Participant

    That worked thanks, code for other users is:

    in reply to: TreeGrid with Array #126101
    trevrobwhite
    Participant

    In jqGrid PHP you can do:

    require_once ABSPATH.”php/PHPSuito/DBdrivers/jqGridArray.php”;

    Then rather than reading data from a database you can read it from an array, I wondered if TreeGrid also supported this and if it could build the tree based on a multidimensional array as in the example?

    in reply to: Date Picker Search on Select #126083
    trevrobwhite
    Participant

    This is fantasic and works a treat, many thanks.

    in reply to: Default Search with Multiple #125949
    trevrobwhite
    Participant

    Many thanks, I will look forward to the next release.

    in reply to: Default Search with Multiple #125946
    trevrobwhite
    Participant

    Thanks for the reply but I’m struggling to get that to work, I will give you the actual example for priority.

    The data contains values 1,2,3,4 or 5 which then displays as text to the user

    I’ve only given part of the code, but it’s the most relevant parts (rather than a 400 odd line file) 😉

    in reply to: CSS Issue with Title Bar #125932
    trevrobwhite
    Participant

    Many thanks, I’ve downloaded the latest theme CSS and added this to the end which has appeared to have cleaned things up.

    in reply to: How to integrate jqGrid with CakePHP #125838
    trevrobwhite
    Participant

    I know this is a really old thread, but does anyone know if this tutorial is still available?

    I’m just moving over to CakePHP and are running into a bit of trouble where to place the files, paths, should the main content be in the controller or view etc.

    Thanks.

    in reply to: Loading Data Across Many Tables #125722
    trevrobwhite
    Participant

    Many thanks, great support, I will check it out.

    in reply to: Loading Data Across Many Tables #125718
    trevrobwhite
    Participant

    Hi Support,

    Many thanks for the reply, I understand SetSelect will set the data for the drop-down/searching, will it also set the data in the action grid itself?

    Also can SetSelect be an SQL query rather than an array (else it will be a massive array)

    Source Data:
    [TABLE]
    [TR][TD]host[/TD][TD]Service[/TD][TD]Other Data[/TD][/TR]
    [TR][TD]1[/TD][TD]1[/TD][TD]Hello 1234[/TD][/TR]
    [TR][TD]2[/TD][TD]1[/TD][TD]Hello 1234[/TD][/TR]
    [TR][TD]2[/TD][TD]2[/TD][TD]Hello 1234[/TD][/TR]
    [/TABLE]

    Data in UI:
    [TABLE]
    [TR][TD]host[/TD][TD]Service[/TD][TD]Other Data[/TD][/TR]
    [TR][TD]Host A[/TD][TD]Service A[/TD][TD]Hello 1234[/TD][/TR]
    [TR][TD]Host B[/TD][TD]Service A[/TD][TD]Hello 1234[/TD][/TR]
    [TR][TD]Host B[/TD][TD]Service B[/TD][TD]Hello 1234[/TD][/TR]
    [/TABLE]

    Many thanks.

    • This reply was modified 4 years, 10 months ago by trevrobwhite. Reason: Correct formatting
    • This reply was modified 4 years, 10 months ago by trevrobwhite.
    in reply to: SubGrids with Grouping #125349
    trevrobwhite
    Participant

    Hi Will,

    Many thanks for the reply, I’ve taken a look at the site you selected and downloaded the code, but I’m having issues targeting it into Guriddo, I’ve tried the following:

    1. Targeting gs_alert_time directly, the result works reasonably well, but I cannot seem to be able to submit the form
    2. Inject the code into the gs_alert_time using appendTo, trouble is here that the code doesn’t get called

    Any ideas?  It would be good to have this natively in the solution at some point as a feature request.

    <script>
    $.datepicker._defaults.onAfterUpdate = null;
    var datepicker__updateDatepicker = $.datepicker._updateDatepicker;
    $.datepicker._updateDatepicker = function( inst ) {
    datepicker__updateDatepicker.call( this, inst );
    var onAfterUpdate = this._get(inst, ‘onAfterUpdate’);
    if (onAfterUpdate)
    onAfterUpdate.apply((inst.input ? inst.input[0] : null),
    [(inst.input ? inst.input.val() : ”), inst]);
    }
    $(document).ready(function() {
    var cur = -1, prv = -1;
    $(‘

    <input id=”jrangeinput”>

    ‘).appendTo(‘#gs_alert_time’);

    $(‘#jrange div’)
    .datepicker({
    //numberOfMonths: 3,
    changeMonth: true,
    changeYear: true,
    showButtonPanel: true,
    defaultDate: -10,
    setDate: ’10-Jul-2016′,
    maxDate: 0,
    beforeShowDay: function ( date ) {
    return [true, ( (date.getTime() >= Math.min(prv, cur) && date.getTime() <= Math.max(prv, cur)) ? ‘date-range-selected’ : ”)];
    },
    onSelect: function ( dateText, inst ) {
    var d1, d2;
    prv = cur;
    cur = (new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)).getTime();
    if ( prv == -1 || prv == cur ) {
    prv = cur;
    //$(‘#jrange input’).val( dateText );
    $(‘#jrange input’).val( $.datepicker.formatDate( ‘dd-M-y’, new Date(Math.min(prv,cur)), {} ));
    } else {
    d1 = $.datepicker.formatDate( ‘dd-M-y’, new Date(Math.min(prv,cur)), {} );
    d2 = $.datepicker.formatDate( ‘dd-M-y’, new Date(Math.max(prv,cur)), {} );
    $(‘#jrange input’).val( d1+’ to ‘+d2 );
    }
    },
    onChangeMonthYear: function ( year, month, inst ) {
    //prv = cur = -1;
    },
    onAfterUpdate: function ( inst ) {
    $(‘<button type=”button” class=”ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all” data-handler=”hide” data-event=”click”>Done</button>’)
    .appendTo($(‘#jrange div .ui-datepicker-buttonpane’))
    .on(‘click’, function () { $(‘#jrange div’).hide(); });
    }
    })
    .position({
    my: ‘left top’,
    at: ‘left bottom’,
    of: $(‘#jrange input’)
    })
    .hide();

    $(document).ready(function(){
    // Populate the inputbox by default
    var dateload = $(‘#jrange div’).datepicker(‘getDate’);
    var dateload2 = $.datepicker.formatDate( ‘dd-M-y’, dateload);

    $(‘#jrange input’).val(dateload2);
    });

    $(‘#jrange input’).on(‘focus’, function (e) {
    var v = this.value,
    d;
    try {
    if ( v.indexOf(‘ to ‘) > -1 ) {
    d = v.split(‘ to ‘);
    prv = $.datepicker.parseDate( ‘dd-M-y’, d[0] ).getTime();
    cur = $.datepicker.parseDate( ‘dd-M-y’, d[1] ).getTime();
    } else if ( v.length > 0 ) {
    prv = cur = $.datepicker.parseDate( ‘dd-M-y’, v ).getTime();
    }
    } catch ( e ) {
    cur = prv = -1;
    }
    if ( cur > -1 )
    $(‘#jrange div’).datepicker(‘setDate’, new Date(cur));
    $(‘#jrange div’).datepicker(‘refresh’).show();
    });
    });
    </script>

     

    • This reply was modified 5 years, 4 months ago by trevrobwhite.
    • This reply was modified 5 years, 4 months ago by trevrobwhite.
    in reply to: SubGrids with Grouping #125334
    trevrobwhite
    Participant

    Many thanks for your reply, that fixed the problem.

    Just one quick additional problem is it possible to default my date-picker to -10 days by default and allow the user to specify a date range?

    I can’t see a way to do this in the jQuery UI without to fields

    Many thanks and assure you I won’t bother you any more after that.

    Thanks.

    in reply to: SubGrids with Grouping #125312
    trevrobwhite
    Participant

    E-mailed you with a dropbox link to the code, many thanks for your help.

    in reply to: Re-define Reload Button #124997
    trevrobwhite
    Participant

    Works a dream thanks, I don’t know why the built in refresh has issues but this works for me.

    in reply to: Filter Toolbar Multi-Pick #124850
    trevrobwhite
    Participant

    That works a lot better thanks, just a final piece of the puzzle to solve.

    When loading this way the sorting and column widths don’t reload. I’d rather have all the information stored in the database, but tried using:

    schema['colmodel'] = jQuery('#grid').jqGrid('getGridParam','colModel');

    then

    jQuery('#grid').jqGrid('setGridParam',{colModel:obj['colmodel']}).trigger("reloadGrid");

    But it doesn’t seem to work, so plan B, use load storage:
    $.jgrid.saveState("grid");

    then
    $.jgrid.loadState("grid");

    I have a lot more success with this, as the grid loads all the preferences, but all the icons in the “pager” toolbar disappear, looking in the console there is a JavaScript error:

    Uncaught TypeError: Cannot read property 'beforeProcessing' of undefined$.ajax.$.extend.success @ jquery.jqGrid.min.js:10j @ jquery.min.js:2k.fireWith @ jquery.min.js:2x @ jquery.min.js:4(anonymous function) @ jquery.min.js:4

    Get this working then everything is good, thanks again for the extended support.

    in reply to: Filter Toolbar Multi-Pick #124837
    trevrobwhite
    Participant

    There are two ways to activate this issue either:
    1. Save the Layout and Reload it
    2. Refresh the grid and new records get inserted

    Here is what I did, load the Grid inside a new browser window (sorry I have to blank some data)
    Image Hosted by ImageTitan.com

    Now I tick High the system correctly filters the grid. When I press this High checkbox an event it fired that refreshes the grid in a different way to jQuery(‘#grid’).trigger(“reloadGrid”); that I want to mimic.

    Image Hosted by ImageTitan.com

    I save the layout and press F5 to reload the entire browser window, then press load, my filters are correctly applied however the data in the grid doesn’t reload correctly.

    Image Hosted by ImageTitan.com

    However if I uncheck High from the priority dropdown and choose it again the data displays correctly.

    I get the same issue if I press the refresh button on the lower toolbar and new records have been added to the database outside the filter.

    So what I want to do is manually trigger the refresh in the same way the multipick does it, then attach this to my load function and the refresh function of the grid.

    Here is the code from my load/save functions, you will notice I also tried to Save the layout (not the data) of the grid, I wanted to save the width and order of the columns, the sorting order, I’ve commented this out because I couldn’t get it to work, but I’ve left it in below, in case you notice some easy fixes in that code as well.

    Many thanks

    • This reply was modified 5 years, 8 months ago by trevrobwhite.
    • This reply was modified 5 years, 8 months ago by trevrobwhite. Reason: images didn't display
Viewing 15 replies - 1 through 15 (of 29 total)

Stay connected with us in your favorite flavor!