jQWidgets Forums

Forum Replies Created

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • in reply to: MVC WebApi Date format MVC WebApi Date format #14300

    alexz
    Member

    Ok, more info:

    jgx version: 2.5.5
    jquery: 1.8.2
    browser: firefox 18.0.1

    In 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?


    alexz
    Member

    jQuery version: 1.8.2
    jQWidgets version: 2.5.5
    device type: PC
    browser name: Firefox
    browser version: 17.0.1

    Create 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.


    alexz
    Member

    I replaced myself datafield with displayfield and it works ok, should you consider this as a bug?

    in reply to: Comma decimal separator Comma decimal separator #12713

    alexz
    Member

    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;
    }
    in reply to: Comma decimal separator Comma decimal separator #12711

    alexz
    Member

    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;
    };

    alexz
    Member

    Unfortunately 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' }); }

    alexz
    Member

    Thanks Peter, now works like a charm!


    alexz
    Member

    Do I have to set also formatString of jqxdatetimeinput?


    alexz
    Member

    Thanks 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.

    in reply to: Dropdowm column and filter Dropdowm column and filter #11041

    alexz
    Member

    Thanks 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.

    in reply to: Horizontal scrollbar Horizontal scrollbar #10884

    alexz
    Member

    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;
    }
Viewing 11 posts - 16 through 26 (of 26 total)