dpeterman said:
Any chance of adding a call back on “done” for the columnChooser? It would nice to be able to save the column configuration to the server.
Also, being able to order the columns would be fantastic. Instead of a list of columns you could have 2 lists. The left hand side would contain the hidden columns and the right hand side for the displayed columns. Then add some up/down arrows to the “display” list to re-order the columns (also drag n drop would nice).
There is a “done” callback, but its harder than necessary to intercept (basically, if you intercept it, you're responsible for calling reorderColumns). This should be fixed…
The default callback does this:
"done" : function(perm) { if (perm) this.jqGrid("remapColumns", perm, true) },
You can replace it with one that does that, and then whatever you want.
As for the re-ordering, and two lists – you described /exactly/ how it works today (except that the displayed items are on the left!).
Im guessing you need to include ui.muiltiselect.js (without that you'll just get a standard element)
Mark
Rumen[Trirand] said:
You can fix this by modifying the .ui-datepicker css class in your ThemeRoller theme (e.g.
Tony wrote:
In other word – make your function with lowecase words – i.e editbuttonformatter (and call it with lower cases) and it will work.
I think that's half the answer. But the other half is here:
{ name: 'editLink', search: false, sortable: false, hidden: false, index: 'editLink', width: 20, align: 'center', formatter: editButtonFormatter }
I believe you need to pass in a string:
formatter: "editButtonFormatter"
(and I dont think the case matters here, just in the definition).
Mark
Yes. I understood your question.
Just before the form is created, the grid calls your onBeforeInit function (if you have one). You can supply one onBeforeInit function for add, and one onBeforeInit for edit.
Use the onBeforeInit functions to change the editoptions for the column in question (ie add or remove the readonly property from colModel).
You also need to set recreateForm to true, to ensure the form is rebuilt every time you call editGridRow (otherwise it just re-uses the previous form, with new values inserted, and wont call onBeforeInit, or look at your colModel options).
Mark
phicarre said:
I replied too quickly …
because now I cannot create a record …
In fact I must have two forms: one for the creation and one for the edition/modification.
Is it possible to have different forms ?
In that case you can set recreateForm true (so that the form gets rebuilt every time you click the add or edit buttons), and use onBeforeInit to set/clear the readonly attribute in the colModel.
Mark
phicarre said:
I replied too quickly …
because now I cannot create a record …
In fact I must have two forms: one for the creation and one for the edition/modification.
Is it possible to have different forms ?
In that case you can set recreateForm true (so that the form gets rebuilt every time you click the add or edit buttons), and use onBeforeInit to set/clear the readonly attribute in the colModel.
Mark
Looks like if you set “recreateForm:true” in the editGridRow options, you'll always get access to this.gbox.
Also, you can always give your serialize function the name of the grid (or even the grid object) via a closure:
myGrid.jqGrid(“navGrid”, …, { …
editoptions:{readonly:"readonly"}
Mark
Hi Tony,
I think you have a typo in your fix:
var
Basdub said:
if($(this)[0].tagName === 'SPAN' && $(this).children(”input”).hasClass(”customelement”)) {
Well, this is fixed in the latest version on github, but until tony releases 3.6.1, you need to include jquery-ui (not grid.jqueryui.js).
You can get it here: http://jqueryui.com/download.
Alternatively, you can include it directly from eg google:
Basically, the custom_value function has two purposes, one to get the value from the form, and post it to the server, and the other to put the value into the form.
Rather than two functions, its a single function, and the second parameter is either “set” or “get” to control which operation it performs.
But basically “get” is your custom_value, and “set” is your custom_format.
The problem is that the call to “set” from fillData is broken, and cant possibly work (again, assuming Im not just confused). So right now, to use a custom element you have to use { recreateForm:true }.
Mark
So it looks like the custom element has changed since the documentation was written:
custom_element.custom_value(jQuery-element, “get”) returns the value of the custom element that should be posted to the server.
And it appears that the corresponding “set” is supposed to set the value in the form… but unless Im very confused its completely broken…
At line 766 of grid.formedit.js we have:
var dummy = cm.editoptions.custom_value($(".customelement",this),'set');
Problem is that “this” is actually the corresponding “td” cell – which probably doesnt /have/ a child with class “customelement”.Even if it did, we wouldnt know which custom element we're supposed to be setting the value of (or, on the other hand, if “this” were the span containing the custom element, we wouldnt know what value to set it to!).
I think its supposed to be
var dummy = cm.editoptions.custom_value($("#"+nm,"#"+fmid),'set',tmp);
Where tmp /is/ the unformatted value of the cell.
So, in other words, apart from the naming convention (and the bug!), everything is supposed to work the way we both want anyway…
Mark
I'll second this one.
fillData should use unformat to get the data, and the custom element should take /that/ string as its input when filling in the value on the edit form.
Mark
src='/photos/ : javascript will search for this folder on your machine !
No, it wont. Try it.
Mark
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top