tony

Forum Replies Created

Viewing 15 replies - 7,756 through 7,770 (of 7,981 total)
  • Author
    Replies
  • in reply to: Can UI Datepicker be added to navigation example? #82341
    tony
    Keymaster

    It is not so difficult. You need to use onInitializeForm which is caled only once whent the form is constructed. if the name of the date field in colModel if mydate, then

    onInitializeForm : function(form_id) {
    jQuery(“#mydate”,form_id).datepicker({showOn: ‘focus’});
    }

    Regards
    Tony

    in reply to: table width #82339
    tony
    Keymaster

    Hi Ton,

    after creating a grid –
    jQuery(“#mytable_id”).width() – will return the actual width
    more precise jQuery(“#mytable_id”).parent(“div”).width()

    before creating the grid you should see (or get) the pixels of the padding and border element in the css.
    That is – if td has padding 2px and border-left 1px you should add 3px for each column
    The hidden element are not calculated any more – 3.2rc

    What is wrong with this?

    Regards
    Tony

    in reply to: jqGrid does not read well formed json #82336
    tony
    Keymaster

    You should configure the jsonReader in jqGrid
    For more information refer to Data Types -> JSON Data -> JSON in documentation

    Regards
    Tony

    in reply to: table width #82335
    tony
    Keymaster

    Hi,
    see the Width and Height item in Docs. You should add the border of the table if any

    Regards
    Tony

    in reply to: jqGrid does not read well formed json #82332
    tony
    Keymaster

    Could you please post how jsonReader look like?

    Regards
    Tony

    in reply to: edit subgrid rows #82331
    tony
    Keymaster

    Hi,
    This line $(“#”+subgrid_id).html(“”); is not needed.
    The error here is that you assign a new id for the subgrid table, but you try to edit row using subgrid id.

    for me this should work:

    onSelectRow: function(id){
    if(id && id!==lastsel){
    jQuery(subgrid_table_id).restoreRow(lastsel);
    jQuery(subgrid_table_id).editRow(id,true);
    lastsel=id;
    }
    }

    Regards
    Tony

    in reply to: edittype:”select” on IE 7 #82329
    tony
    Keymaster

    This bug has been reported by another user.
    The problem is that this occur in certain versions of IE7 (do not known which). In my IE7 all work OK. Anyway I have updated this with a stopPropagation() – try the 3.2rc.

    Regards
    Tony

    in reply to: Multirow header #82328
    tony
    Keymaster

    This feature is not in short term plan.

    Regards
    Tony

    in reply to: How to tie a fuction to Modal select onChange #82327
    tony
    Keymaster

    Use onInitializeForm event
    something like

    onInitializeForm:function(form_id) {

    jQuery(“#select_id”,form_id).change(function(){

    });


    }

    Regards
    Tony

    in reply to: edit subgrid rows #82325
    tony
    Keymaster

    This is possible if you use grid as Subgrid. In this case subgrid is like another grid. Check again the id’s when you create editable subgrid.

    Regards
    Tony

    in reply to: Method For Adding SubGrid (aka SubGrid in Array Data) #82324
    tony
    Keymaster

    Will look, but I think that a more common solution is to add
    subgriddatatype (xml,json,clientSide)

    then if the data is local we can easy extend the subgrid to add array data.
    Another options that is very good to have is to cache the subgrid data – i.e the data should be loaded only once and then when pressing the plus icon only to show the content.

    Regards
    Tony

    in reply to: Dynamically populate editortype select (json) #82320
    tony
    Keymaster

    There is a more easy way. If you use formedit you can use the method
    setColProp(colname, newproperty)

    in your case setColProp(‘myname’,editoptions:{value: ‘newvalues here’})

    Regards
    Tony

    in reply to: how to get option key value of “select” editType ? #82318
    tony
    Keymaster

    Mike,
    The key is not hidden. It is constructed when you edit the row.
    It is possible to do that, but it is a little heavy.

    Let’s suppose you call getRowData – this return array of type name:value

    You known the name of the defined selectbox – right! You known the index of this col in the colModel too.
    Now you should extract the data from editoptions for this field

    var model = jQuery(“#mygrid”).getGridParam(‘colModel’);
    var editopt = model[index].editoptions[value].split(“;”)

    Now editopt is array of type key:value of the sectbox
    You have the selected value – then the key is…
    for (i in editopt) {
    if(editopt = ‘selected_value’){
    alert(i) // this is the key
    break;
    }
    }

    Regards
    Tony

    in reply to: Dynamically populate editortype select (json) #82317
    tony
    Keymaster

    John,

    You can use setGridParam something like

    jQuery(“#mygrid”).setGridParam({colModel[index].editoprions:{myoptiyns_here}});

    where the index is the index of the column beginning from 0 in the colModel

    Regards
    Tony

    in reply to: Add new row not working properly after delete row? #82316
    tony
    Keymaster

    Mike,
    afterSubmit accept two parameter (as of the docs)
    the first one is the data returned from the server.
    This data can be in in what you want format. You should get this data – transform it to array and send it back to jqGrid.

    Here is a brief example.
    Lets suppose that you return from server the flowing data
    success;the_newid (I suppose all is ok – succes)
    then

    afterSubmit: function(server_data, posted_data) {
    result = server_data.responseText.split(“;”)
    if (result[0] == “success”)
    return [true,””,result[1]];
    else return [false,”Error inserting row”];
    }

    Enjoy
    Tony

Viewing 15 replies - 7,756 through 7,770 (of 7,981 total)

Stay connected with us in your favorite flavor!