jQWidgets Forums
Forum Replies Created
-
Author
-
Ok, more info:
jgx version: 2.5.5
jquery: 1.8.2
browser: firefox 18.0.1In order to reproduce this, you need ASP.NET MVC Controller returning some entity with DateTime or DateTimeOffset, configure grid to consume controllers data as json, and column which in my case was like:
{text: 'Alkuaika', datafield: 'StartDate', createeditor: function (row, value, editor) { editor.jqxDateTimeInput({ culture: 'fi-FI' }); },columntype: 'datetimeinput',cellsformat: 'd.M.yyyy H:mm'}
Alternatively if you don’t do ASP.NET MVC stuff, you can put string like this ‘2013-01-01T00:00:00+00:00’ in json data array and make grid to consume it.
The column shows it’s value like ‘2013-01-01T00:00:00+00:00’, not in ‘d.M.yyyy H:mm’ format. After I edit column, it works ok, and date is show like it should be, in ‘d.M.yyyy H:mm’ format.
As I found from the source code, the jqxdata module’s isDate function received the string ‘2013-01-01T00:00:00+00:00’ as an argument and then naturally discarded it as an invalid date.
Can you continue with that information, Peter?
January 9, 2013 at 1:47 pm in reply to: Columns resize and displayfield Columns resize and displayfield #13378jQuery version: 1.8.2
jQWidgets version: 2.5.5
device type: PC
browser name: Firefox
browser version: 17.0.1Create jqxGrid combobox column with specified datafield and displayfield, where datafield is int and displayfield data contains strings of length greater than column header. Call grids autoresizecolumns. Notice, that column width is adjusted by it’s header, not it’s data. this is because resize script uses datafield to calculate column width, not it’s displayfield.
January 9, 2013 at 12:54 pm in reply to: Columns resize and displayfield Columns resize and displayfield #13370I replaced myself datafield with displayfield and it works ok, should you consider this as a bug?
Currently I got rid of the error by stabbing the library file jqxgrid.edit, but it’s always bad idea:
case "numberinput": if (this.editcell.editor.jqxNumberInput) { var c = this.editcell.editor.jqxNumberInput("getDecimal"); // TODO: library modification! if (c != null || c != '') { c = c.replace(this.editcell.editor.jqxNumberInput("decimalSeparator"), "."); c = c.replace(this.editcell.editor.jqxNumberInput("groupSeparator"), ""); } f = new Number(c); f = parseFloat(f); if (isNaN(f)) { f = 0; } if (d.displayfield != d.datafield) { f = { label: f, value: f }; } } break; }
The column declaration:
{text: 'Korkeus', datafield: 'Height',cellsrenderer: function (row, column, value, defaultHtml, columnProperties) { return decimalDisplayColumnRenderer (row, column, value, defaultHtml, columnProperties); }, columntype: 'numberinput',createeditor: function (row, value, editor) { editor.jqxNumberInput({ decimalSeparator: ',', groupSeparator: ' ' }); }}
The renderer function (not important, createeditor seems to be the main cause)
var decimalDisplayColumnRenderer = function(row, column, value, defaultHtml, columnProperties) { var element = $(defaultHtml); var content = jQuery.global.format(value, 'n'); element.text(content); if (element.length > 0) { return element[0].outerHTML; } return content;};
November 27, 2012 at 12:31 pm in reply to: Setting calendar culture inside grid Setting calendar culture inside grid #11545Unfortunately still have a problem, calendar comes localized, but date is in default culture format, like 11.27.2012, should be 27.12.2012
createeditor:function (row, value, editor) { editor.jqxDateTimeInput({ culture: 'fi-FI' }); }
November 27, 2012 at 10:06 am in reply to: Setting calendar culture inside grid Setting calendar culture inside grid #11534Thanks Peter, now works like a charm!
November 27, 2012 at 9:52 am in reply to: Setting calendar culture inside grid Setting calendar culture inside grid #11530Do I have to set also formatString of jqxdatetimeinput?
November 27, 2012 at 9:47 am in reply to: Setting calendar culture inside grid Setting calendar culture inside grid #11528Thanks for prompt reply, now I added following functions (initeditor added after no success with createeditor):
createeditor:function (row, value, editor) { editor.jqxCalendar({ culture: 'fi-FI' }); }, initeditor:function (row, value, editor) { editor.jqxCalendar({ culture: 'fi-FI' }); }
but with no success, tried also to remove
columntype: 'datetimeinput'
but then column has just textbox editor.
November 15, 2012 at 9:36 am in reply to: Dropdowm column and filter Dropdowm column and filter #11041Thanks for prompt reply, but do you have any workaround? It’s quite common, if you have dropdown control it’s value is integer and text is visible to the user. It’s counter-intuitive when you have to sort or filter this column by value you do not see.
Thanks Peter,
I’ve finally came up with solution like that:
autoresize: function() { this.autoresizecolumns(); var width = 0; var columns = this.columns; for (var i = 0; i < columns.records.length; i++) { var columnRecord = columns.records[i]; if (!columnRecord.hidden) { width += columnRecord.width; } } this.width = width; }
-
AuthorPosts