Jayesh
Jayesh

Reputation: 6111

GWT EXT Grid containing Checkbox with dynamic Column to add?

I want Grid similar to this image

I am very new to GWT and I have to make GWT Grid like the image shown.

I have no clue on how to do this with corresponding Update and Delete action against each row.

Here, the number of columns ie Create, Update, Delete etc are dynamic and coming from Database. Also, the number of rows ie Viewer, Admin, Creator is coming from Database.

I want update and delete button fro each row as well with corresponding actions.

Boxes are checkbox for giving privileges to Viewer, Admin etc.

I am using EXT GWT, I am aware of BaseModel but have no idea how to do this using that.

Please help me. Thanks.

Upvotes: 1

Views: 737

Answers (1)

Pablo Chvx
Pablo Chvx

Reputation: 1931

For each editable column, create an editor:

//YOUR COLUMN:      
colSubTotalD = new ColumnConfig("subTotal", "Subtotal", 80);
...
//AN EDITOR
NumberField txtSubTotal = new NumberField();
...
colSubTotalD.setEditor(new CellEditor(txtSubTotal));

Then, create and asign a RowEditor:

re = new RowEditor<ModelData>();
re.setClicksToEdit(ClicksToEdit.TWO);
re.addListener(Events.AfterEdit, new Listener<RowEditorEvent>() {
    public void handleEvent(RowEditorEvent e) {
        //{DO WHATEVER YOU NEED};
    }
});
yourGrid.addPlugin(re);

With this, your grid will enter in edit mode after a double clic. And you can handle the changes on the roweditor event.

Upvotes: 1

Related Questions