Opened 10 years ago

Closed 6 years ago

#9668 closed enhancement (patchwelcome)

Editable grid with ValidationTextBox does not work

Reported by: Ian Fouls Owned by: Bryan Forbes
Priority: high Milestone: future
Component: DojoX Grid Version: 1.3.2
Keywords: grid ValidationTextBox Cc:
Blocked By: Blocking:

Description

There is no functionality built into the grid to allow text editing with simple requirements of say a required field or a basic regular expression. Attempting to use the constraint attribute within a grid cell does not work as this does not map with the use of constraints within the ValidationTextBox? widget.

It's a little odd that more complex editing requirements have been dealt with but the basics of required text or simple pattern matching have not been addressed.

Looking through the code I think the only way to do this is to write a validator function in a custom edit widget. This is getting silly for such a basic requirement.

Attached is a modified version of the test_edit_dijit.html using a ValidationTextBox? and attemptint to specify a constraint, clearly this isn't going to work but I feel it should do.

Would it not be more sensible to include a grid dijit widget based on ValidationTextBox? rather than expecting developers to create custom widgets for basic requirements?

Attachments (1)

test_edit_dijit.html (4.4 KB) - added by Ian Fouls 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Ian Fouls

Attachment: test_edit_dijit.html added

comment:1 Changed 10 years ago by Nathan Toone

Milestone: tbdfuture
Priority: highnormal
Type: defectenhancement

comment:2 Changed 9 years ago by haysmark

This is just a TODOC, I'm not sure who special-cased constraints or why they did it. The correct strategy for setting arbitrary widget attributes is to specify the widgetProps on the cell:

{ name: 'Message', field: 'col4', styles: '', width: 10,  widgetProps:{regExp: '[`]+'}, widgetClass: dijit.form.ValidationTextBox},

This makes Message only match values which contain one or more ` mark.

comment:3 Changed 6 years ago by bill

DojoX Grid and EnhancedGrid are deprecated in favor of dgrid and gridx.

You should upgrade your code to use one of those two grids.

We will consider patches to the old DojoX Grid code though.

comment:4 Changed 6 years ago by bill

Resolution: patchwelcome
Status: newclosed
Note: See TracTickets for help on using tickets.