alphadog

Forum Replies Created

Viewing 15 replies - 1 through 15 (of 21 total)
  • Author
    Replies
  • in reply to: CellEdit Oddity #98032
    alphadog
    Participant

    UPDATE: The early event triggering seems to happen in both IE8 and FF4. For some reasoin, although I was getting two alert notices in FF4, I cannot reproduce that behavior. Also, in both cases, seems like no params are being pased in.

    PREVIOUS COMMENT WAS: Actually, to add: IE8 fires once when entering the cell, before the text gets converted to a textbox. In FF4, you get that incorrect behavior and also the apparently more timely post-edit. So, IE8 does it once at the wrong time, and FF4 does it twice, once wrong. (And, in all cases, all params like celname are undefined.)

    in reply to: Cell Tooltip #82099
    alphadog
    Participant

    Working on it, but I need a mouseover override. See my other post entitled: Modify The Mouseover/New Event Needed

    in reply to: More IDs And Classes #82097
    alphadog
    Participant

    Actually, I worked out one way to add IDs. In addCell, line 403. After the line:

    row.appendChild(td);

    I added the lines:

    $(td,t).attr(“id”, “jqGrid_cell_” + row.id + “_” + pos );
    $(td,t).addClass(“jqGrid_row_” + row.id );
    $(td,t).addClass(“jqGrid_col_” + pos );

    (Instead of jqGrid, it would be better to maybe use the grid name, but I don’t know how to get it from there.)

    Not sure about where else this may be needed, or how this could ruin anything. Is this appropriate?

    in reply to: Cell Tooltip #82074
    alphadog
    Participant

    Okay, so I noted that there is a kind of tooltip currently.

    So, where and how is this behavior set?

    First, I want to see if I can modify this behavior. Else, I will have to get more creative…

    in reply to: Per-Column CSS #82024
    alphadog
    Participant

    Sure. I guess it all depends on how it is being done now. For example, when I click a row, it gets highlighted yellow. How would I control that highlight color in a given column?

    in reply to: Rows number, span column, multi-sort #82018
    alphadog
    Participant

    Yes, column user-feedback on sorting is sorely missing. Useability and what not.

    Multi-column sort would be useful also. Ability to sort by a, then b.

    in reply to: Access JSON Data On Load Callback #82003
    alphadog
    Participant

    BTW, I leave an XML version of this as an “exercise to the reader”.

    Tony, I will send another copy of a rev.28 where both my modifications reside.

    And, I would rather think: Thank you for all the jqGrid code. Makes my life much easier!!

    in reply to: Access JSON Data On Load Callback #81999
    alphadog
    Participant

    Oops. The first block of code above should have the JSON object named “retvals”, not “return”.

    in reply to: Access JSON Data On Load Callback #81998
    alphadog
    Participant

    I have changed my code a little. I isolated returned values to an expected object (like “rows”) named “retvals” (by default) in the returned JSON. The name of the object can be changed in jReader, as other items can.

    So, basically, the JSON has to look something like:

    {"page":"1","total":"163","records":"1630","return":{"ttlAll":"3636.84","ttl30":"3636.84","ttl60":"0","ttl90":"0"},"rows":[...

    Now, I added one more property to the jqGrid called:

    returnedData: {}

    And, two functions:

    $.fn.getReturnedData = function(){
    return this[0].p.returnedData;
    };

    $.fn.getReturnedDataItem = function( key ) {
    return this[0].p.returnedData[key];
    };

    The addJSONData() function only needs:

    ts.p.returnedData = data[ts.p.jsonReader.retvals];

    to get the JSON object into the jqGrid object. This avoids the need to worry about collision in property names, too.

    Then, it can easily be used by calling the getters.


    loadComplete: function(){
    alert( $("#resultList").getReturnedDataItem("ttlAll") )
    }

    Does that look appropriate?

    in reply to: Access JSON Data On Load Callback #81996
    alphadog
    Participant

    That is a KISS approach that is great, except in one scenario: I may want to reuse the data returned in the JSON object in multiple functions, so passing and discarding within loadComplete() limits that ability.

    What would be the best way to add the JSON data to the jqGrid object dynamically?

    So far, I thought I could add the code below to addJSONData() right after the ts.p.records line, such that any property in the JSON not in the jqGrid object would be added directly:

    for(var pr in data) {
    // how to avoid someone naming a JSON property like an jqGrid property from stomping on jqGrid property?
    if( (typeof(ts.p[pr]) == "undefined") && (pr != "total") && (pr != "rows") ) {
    ts.p[pr] = data[pr];
    //ts.fn["get" + pr] = function(){return this[0].p[pr];};
    //ts.fn["set" + pr] = function(val) { return this.each( function(){this.p[pr]=val;}); };
    }
    }

    I don’t have the calling convention right yet, and I’m not sure I know how to handle the case of pre-existing properties, but what do you think of this approach conceptually?

    in reply to: POST vs. GET #81983
    alphadog
    Participant

    Re-reading my post, it looks hostile. I did not mean it that way. I meant that I modified your wonderful grid to suit my immediate needs, but if it doesn’t fit your design and architecture, well, I understand and do not want to force anything on anyone. 🙂

    I have sent my jqGrid file to your email.

    in reply to: jqGrid conflicts with DDAccordion #81980
    alphadog
    Participant

    Yes. I noted that in your new rev and assumed that most likely was the reason.

    When I diff’ed rev 8 to rev 28, I could find no other code change that would explain it.

    Again, thanks for your time. Sorry to have worried you.

    in reply to: POST vs. GET #81979
    alphadog
    Participant

    Well, you could do it that way.

    But, a fundamental problem still remains if you have to pass a big chunk of data to your service even if only doing a GET with no side-effects. Sometimes, you can’t put all your params in the URL because of a variety of reasons: a) would cause the url to exceed allowable URL lengths on some browsers, b) contains non-ASCII chars, etc.

    I didn’t think my free code would get push-back. You don’t have to use it if you don’t want it.

    But, it works for my uses… Thanks for your time.

    in reply to: jqGrid conflicts with DDAccordion #81973
    alphadog
    Participant

    Updating to rev.28 fixed the issue. Not sure why, but no time to dwell on the past! 🙂

    in reply to: POST vs. GET #81972
    alphadog
    Participant

    Yes, I’ve seen that in the example, but there is no way to get user-defined params added and sent via POST is there, or am I being obtuse?

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

Stay connected with us in your favorite flavor!