Tony Russo

Forum Replies Created

Viewing 15 replies - 1 through 15 (of 31 total)
  • Author
    Replies
  • in reply to: Conditionally adding/removing subgrid #123501
    Tony Russo
    Participant

    Thanks Tony, I’ll give that a try.

    What if I wanted to display a count of rows in place or next to the subgrid icon, any thoughts?

    in reply to: add row beforeShowForm select #121217
    Tony Russo
    Participant

    I sent it to support at trirand dot com.

    I will resend it from another client.

    in reply to: add row beforeShowForm select #121188
    Tony Russo
    Participant

    Hi Tony,

    Is there any way to change this to a span vs select.

    Also is there any way to do a loading image while waiting for the server to send the select options?

    in reply to: onPaging event not working with pginput element #121187
    Tony Russo
    Participant

    Hi Tony,

    I sent the whole jqGrid setup by email as requested.

    Any update as to why the event is not raised?

    in reply to: add row beforeShowForm select #120640
    Tony Russo
    Participant

    Hi Tony,

    Building the select on the server side.

    Only downside to an empty option value and text of “No Rows Available” allows the client to send the request where for the server to process.

    Our thinking was adding a span or making the select readonly would eliminate the possibility of the client sending the empty request.

    Also we need to add a loading image for the select. At times when the server is busy or the select is large it takes a moment for the select to populate.

     

    in reply to: Adding subgrid row #120639
    Tony Russo
    Participant

    I did so many things, I’m not really sure what I did to fixed it.

    Updated jqgrid to 4.7.1

    Changed subgrid loadonce to false.

    And a lot more…

     

    here’s the working code.

    $(document).ready(function () {

    var _rowid;

    $(“#jqGrid”).jqGrid({
    url: ‘DataFiles.htm’,
    mtype: “POST”,
    datatype: “json”,
    postData: {oper:’load’,mode:’assistant’,method:’data’},
    colModel: [
    { label: ‘AgentID’, name: ‘AgentID’, index: ‘AgentID’, hidden: false, key: true },
    { label: ‘OfficeID’, name: ‘OfficeID’, index: ‘OfficeID’, hidden: true },
    { label: ‘Name’, name: ‘Name’, index: ‘Name’, hidden: false, width: 250, align: ‘left’, editable: false, search: true },
    { label: ‘Office’, name: ‘Office’, index: ‘Office’, hidden: false, width: 400, align: ‘left’, editable: false, search: true },
    { label: ‘User Cass’, name: ‘UserClass’, index: ‘UserClass’, hidden: false, width: 150, align: ‘left’, editable: false, search: true },
    { label: ‘Status’, name: ‘Status’, index: ‘Status’, hidden: false, width: 100, align: ‘center’, editable: false, search: true },
    { label: ‘Assistants’, name: ‘Assistants’, index: ‘Assistants’, hidden: false, width: 100, align: ‘center’, editable: false, search: true }
    ],
    sortable: true,
    viewrecords: true,
    ignoreCase: true,
    height: 300,
    width: 900,
    rowNum: 40,
    rowList: [40, 80, 100, 200],
    pager: “#jqGridPager”,
    subGridBeforeExpand: function(divid, rowid) {
    _rowid = rowid;
    var expanded = jQuery(“td.sgexpanded”, “#jqGrid”)[0];
    if(expanded) {
    setTimeout(function(){
    $(expanded).trigger(“click”);
    }, 100);
    }
    },
    jsonReader: {
    subgrid : { repeatitems: false}
    },
    subGrid: true, // set the subGrid property to true to show expand buttons for each row
    subGridRowExpanded: showChildGrid, // javascript function that will take care of showing the child grid
    subGridOptions: {
    “plusicon” : “ui-icon-triangle-1-e”,
    “minusicon” : “ui-icon-triangle-1-s”,
    “openicon” : “ui-icon-arrowreturn-1-e”,
    “reloadOnExpand” : false,
    “selectOnExpand” : true
    }
    });

    $(‘#jqGrid’).navGrid(“#jqGridPager”, {
    search: true, // show search button on the toolbar
    add: false,
    edit: false,
    del: false,
    refresh: true
    },
    {}, // edit options
    {}, // add options
    {}, // delete options
    {) // search options – define multiple search
    );
    function showChildGrid(parentRowID, parentRowKey) {
    var childGridID = parentRowID + “_table”;
    var childGridPagerID = parentRowID + “_pager”;
    var _officeid = $(“#jqGrid”).jqGrid(“getCell”, _rowid, “OfficeID”);
    var _agentid = $(“#jqGrid”).jqGrid(“getCell”, _rowid, “AgentID” );
    $(‘#’ + parentRowID).append(‘<table id=’ + childGridID + ‘></table><div id=’ + childGridPagerID + ‘ class=scroll></div>’);
    $(“#” + childGridID).jqGrid({
    url: ‘DataFiles.htm’,
    editurl: ‘DataFiles.htm’,
    mtype: “POST”,
    datatype: “json”,
    postData: {oper:’loadsubgrid’,mode:’assistant’,method:’data’,AgentID: _agentid,OfficeID: _officeid},
    page: 1,
    colModel: [
    { label: ‘Agent ID’, name: ‘pAgentID’, align: “left”, width: 300, key: true, index: ‘pAgentID’ },
    { label: ‘Personal Assistant’, name: ‘pName’, align: “left”, width: 400, stype:’select’, editable: true, edittype:”select”,
    editoptions: {
    dataUrl: ‘DataFiles.htm?oper=loadselect&mode=assistant&method=data&parent_id=’ + _rowid + ‘&OfficeID=’ + _officeid + ‘&AgentID=’ + _agentid
    }
    }
    ],
    width: 500,
    height: ‘100%’,
    pager: “#” + childGridPagerID//,
    });
    $(“#” + childGridID).navGrid(“#” + childGridPagerID, {
    search: false, // show search button on the toolbar
    add: true,
    edit: false,
    del:true,
    refresh: true
    },
    {}, // edit options
    { // add options
    mtype: “POST”,
    closeAfterAdd: true,
    closeAfterEdit:true,
    reloadAfterSubmit: true,
    addCaption: “Add Personal Assistanat”,
    bSubmit : “Add”,
    bCancel : “Cancel”,
    left:250,
    top: 200,
    onclickSubmit: function(rowid){
    _OfficeID = $(“#jqGrid”).jqGrid(“getCell”, _rowid, “OfficeID”);
    _AgentID = $(“#jqGrid”).jqGrid(“getCell”, _rowid, “AgentID”);
    var val = $(this ).getCell(rowid, ‘pAgentID’);
    return {oper:’add_subgrid_row’,mode:’assistant’,method:’data’,parent_id:_rowid,OfficeID:_OfficeID,AgentID:_AgentID };
    },
    afterSubmit : function(response, postdata)
    {
    success = true;
    message = ‘OK’;
    new_id = 1;

    //this forces true always, need more work here for error checking

    _Assistants = $(“#jqGrid”).jqGrid(“getCell”, _rowid, “Assistants”);
    _Assistants = parseInt( _Assistants ) + 1;
    $(“#jqGrid”).jqGrid(‘setCell’, _rowid, ‘Assistants’, _Assistants);

    return [true,”,”];
    }

    },
    { // delete options
    mtype: “POST”,
    onclickSubmit: function(rowid){
    var myGrid = $(“#” + childGridID);
    selRowId = myGrid.jqGrid (‘getGridParam’, ‘selrow’),
    celValue = myGrid.jqGrid (‘getCell’, selRowId, ‘pAgentID’);
    _OfficeID = $(“#jqGrid”).jqGrid(“getCell”, _rowid, “OfficeID”);
    _AgentID = $(“#jqGrid”).jqGrid(“getCell”, _rowid, “AgentID”);

    _Assistants = $(“#jqGrid”).jqGrid(“getCell”, _rowid, “Assistants”);
    _Assistants = parseInt( _Assistants ) – 1;
    $(“#jqGrid”).jqGrid(‘setCell’, _rowid, ‘Assistants’, _Assistants);

    return {oper:’del_subgrid_row’,mode:’assistant’,method:’data’,parent_id:_rowid,AgentID: _AgentID, OfficeID:_OfficeID };
    },

    //need more work here for error checking, possibly in afterSubmit

    beforeShowForm: function(form) {
    _this_row = jQuery( this ).jqGrid(‘getGridParam’,’selrow’);
    _this_name = $( this ).jqGrid(“getCell”, _this_row, “pName”);

    $(“td.delmsg”,form).html(“xDo you really want delete <b>” + _this_name + “</b>?”);
    },
    width:300,
    addCaption: “Delete Personal Assistanat”,
    left:250,
    top: 200
    },
    { // search options – define multiple search
    //multipleSearch: true,
    //multipleGroup: true,
    //showQuery: true,
    //groupOps: [ { op: “AND”, text: “and” }, { op: “OR”, text: “or” }, { op: “NOT”, text: “not” } ],
    //matchText: ” match”
    }
    );

    }
    });

    in reply to: Adding subgrid row #120612
    Tony Russo
    Participant

    I’ve resolved the problem after making a number of changes to my original code.

    All is working now.

    in reply to: Adding subgrid row #120500
    Tony Russo
    Participant

    Update,

    The following code seems to close the add window but does not load the grid with the new row.

    Is it necessary to insert the new row on the client side?

    Or ca n a reloadGrid update the client from the server database with the new row in the database?

    In either case i don’t see the new row on the client side, I do see it added to the database on the server side.

    Also i don’t see the subgrid refresh on the server.

     

    { // add options
    mtype: “POST”,
    closeAfterAdd: true,
    closeAfterEdit:true,
    reloadAfterSubmit: true,
    addCaption: “Add Personal Assistanat”,
    bSubmit : “Add”,
    bCancel : “Cancel”,
    left:250,
    top: 200,

    onclickSubmit: function(rowid){
    _OfficeID = $(“#jqGrid”).jqGrid(“getCell”, _rowid, “OfficeID”);
    _AgentID = $(“#jqGrid”).jqGrid(“getCell”, _rowid, “AgentID”);
    var val = $(this ).getCell(rowid, ‘pAgentID’);
    return {oper:’add_subgrid_row’,mode:’assistant’,method:’data’,parent_id:_rowid,OfficeID:_OfficeID,AgentID:_AgentID };
    },

    afterSubmit : function(response, postdata)
    {
    var myGrid = $(“#” + childGridID);
    success = true;
    message = ”;
    new_id = ”;

    $(“.ui-icon-closethick”).trigger(‘click’); //this closes add window
    myGrid.trigger(“reloadGrid”); //not working – suppose to reload grid,

    return [success,message,new_id]
    }
    },

    in reply to: Posting and BBCodes #115334
    Tony Russo
    Participant

    Hi Tony,

    For this post I’m using Chrome in OS X Yosemite.
    .
    I’m using a period (.) to separate paragraphs.
    .
    In this first code, it was pasted into the post, highlighted then clicked code editor, then clicked add
    .

    <pre class=”lang:js decode:true ” >
    $(“#jqGrid”).navGrid(#jqGridPager, {

    multipleSearch: true,
    multipleGroup: true,
    showQuery: true,
    tmplNames: [Template One, Template Two],
    tmplFilters: [template1, template2],

    });

    .
    This code I clicked on code editor, then pasted the code into editor then clicked on add.
    .
    <pre class=”lang:js decode:true ” >
    $(“#jqGrid”).navGrid(#jqGridPager, {

    multipleSearch: true,
    multipleGroup: true,
    showQuery: true,
    tmplNames: [Template One, Template Two],
    tmplFilters: [template1, template2],

    });

    Tony

    in reply to: Saved Filters #115308
    Tony Russo
    Participant

    Oh I see the roadmap for Q1 2015.
    .
    We may need to look for another solution if it the release goes to March.
    .
    Regards,
    Tony

    in reply to: Posting and BBCodes #115307
    Tony Russo
    Participant

    Not sure, could have used a mac laptop or windows desktop last time.
    .
    I’m on the mac laptop now, browser is Safari v8.0.2, OS – Mac OS X Yosemite.
    .
    Copied the code above, pasted it into post, highlighted, then clicked code editor button.
    .

    <pre class=”lang:js decode:true ” >
    //this code retuerns the current filter in use
    var currentfilter = $(“#jqGrid”).jqGrid(‘getGridParam’,’postData’).filters;

    //this is our setup for templNames and tmplFilters

    $(“#jqGrid”).navGrid(#jqGridPager, {

    multipleSearch: true,
    multipleGroup: true,
    showQuery: true,
    tmplNames: [Template One, Template Two],
    tmplFilters: [template1, template2],

    });

    var template1 =
    { “groupOp”: “AND”,
    “rules”: [
    { “field”: “Account”, “op”: “eq”, “data”: “XYZ” },
    { “field”: “Name”, “op”: “cn”, “data”: “Smith”}
    ]
    };

    var template2 =
    { “groupOp”: “AND”,
    “rules”: [
    { “field”: “Name”, “op”: “eq”, “data”: “Carnes” },
    { “field”: “OrderID”, “op”: “le”, “data”: “10255”}
    ]
    };

    in reply to: Saved Filters #115306
    Tony Russo
    Participant

    OK, thanks.

    Do you have a roadmap or schedule for your next release?

    in reply to: Posting and BBCodes #115293
    Tony Russo
    Participant

    OK, this is a test

    The code above…I pasted the code in the form, selected it and pressed code editor, then add.

    • This reply was modified 11 years, 3 months ago by Tony Russo.
    • This reply was modified 11 years, 3 months ago by tony.
    • This reply was modified 11 years, 3 months ago by tony.
    • This reply was modified 11 years, 3 months ago by tony.
    in reply to: Saved Filters #115292
    Tony Russo
    Participant

    Thank you.
    .
    Do you have any kind of time frame for this?

    in reply to: Saved Filters #115283
    Tony Russo
    Participant

    Setting recreateFilter to true results in template select element to default.
    .
    Problem is we need recreateFilter: true so we can add or delete filters but we do not want the template select to reset to default.

Viewing 15 replies - 1 through 15 (of 31 total)

Stay connected with us in your favorite flavor!