Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

ListGrid startEditingNew() carrying over error icons from previous row

$
0
0
SmartClient Version: v8.3p_2013-11-10/Pro Deployment (built 2013-11-10)

Hi,

I'm having trouble when adding a new row to a ListGrid using startEditingNew() where one of the fields is flagged for server only validation.

If this field fails validation an error icon is displayed correctly against it. The user is allowed to complete the row, even though a field failed validation, and add

a further new row. But on adding the next new row an error icon is displayed incorrectly against the field in the new row that corresponds to the field that errored in

the previous row.

Below is a test case that illustrates the problem.

Thanks in advance for any help.

Test Case :
Code:

    var ds = isc.RestDataSource.create({
        dataProtocol: "postParams",
        dataFormat: 'json',
        useStrictJSON: true,
        dataURL: "grid.ashx",
        fields: [
          { name: "ID", type: "integer", title: "ID", primaryKey: true },
          { name: "job",
              type: "text",
              title: "Job",
              validateOnExit: true,
              validators: [{ "serverOnly": true}]
          },
          { name: "number", type: "float", title: "Value" }
        ]
    });

    var grid = isc.ListGrid.create({
        ID: "grid",
        dataSource: ds,
        width: 500,
        height: 500,
        autoFetchData: true,
        canEdit: true
    });

    var vlayout = isc.VLayout.create({
    });

    var tstrip = isc.ToolStrip.create({
        ID: "ToolStripModes",
        width: "100%"
    });

    var addbutton = isc.IconButton.create({
        ID: "btnAdd",
        title: "Add",
        icon: "[SKIN]/actions/add.png",
        click: "grid.startEditingNew()"
    });
    tstrip.addMember(addbutton);

    vlayout.addMember(tstrip);
    vlayout.addMember(grid);

JSON response from the server for the inital data fetch :
Code:

{"response":{"status":0,"errors":[]}}
JSON response from the server from validation of the 'job' field in the first row :
Code:

{"response":{"status":-4,"errors":[{"job":"invalid job"}]}}

Viewing all articles
Browse latest Browse all 4756

Trending Articles