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
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
You should configure the jsonReader in jqGrid
For more information refer to Data Types -> JSON Data -> JSON in documentation
Regards
Tony
Hi,
see the Width and Height item in Docs. You should add the border of the table if any
Regards
Tony
Could you please post how jsonReader look like?
Regards
Tony
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
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
This feature is not in short term plan.
Regards
Tony
Use onInitializeForm event
something like
onInitializeForm:function(form_id) {
jQuery(“#select_id”,form_id).change(function(){
…
});
…
}
Regards
Tony
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
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
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
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
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
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
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top