Web AppBuilder - Eventhandling (row-edit) with jimu.js/dijit/SimpleTable

3979
7
Jump to solution
07-30-2015 12:25 AM
StefanP__Jung
Occasional Contributor

Some of the Esri out of the box Widgets are using the jimu.js/dijit/SimpleTable for creating a Table.

To make my Widget responsive i thought using the SimpleTable is the best method for now. So i don't have to care about the styling and can use all the features the SimpleTable comes with.

It's easys to create a new table and fill it with data, but the eventhandling is not 100% working like excepted.

If you want a user to be able to edit text within the table you can set the Parameter 'editable: true' for a field. But there is no event that notifies if the user has edited a field. The event 'row-edit' is not fired in this case. It looks like that this event is only fired when the row is updated programatically.

Does anyone have some experience with the SimpleTable? Currently I am thinking about modifying the SimpleTable.

- Stefan

1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Stefan,

   Nope you have it all right. There is just currently no event that I am aware of that fires after a field has been edited. In many of my widget I include a custom copy of SimpleTable so that I can add additional features or events.

View solution in original post

0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus

Stefan,

   I use "actions-edit" when using SimpleTable as I noticed as you did that "row-edit" is only fired when programmatic changes are made.

0 Kudos
StefanP__Jung
Occasional Contributor

Hi Robert,

i've used the 'actions-edit' in an other SimpleTable where the user can edit more than just one field. In this case I open a Popup for the edit action.

But just for editing one field I don't want to open a new popup. Neither i want to implement the editing within the table by myself.

Did you work with the 'editable: true' property or did you implement it youself ?

- Stefan

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Stefan,

    I do use editble: true but in my case I don't need to respond to the event of a single field being edited. I just get the tables values when the dialog is closed and commit those to the json.

0 Kudos
StefanP__Jung
Occasional Contributor

Hi Robert,

for me it would be enough if i would get any event after the user has edited the field. I don't even need the TR that has been edited.I Could iterate over the table after the event has been fired.

When using 'editable:true' for a field the user will edit the field with a double click, and it will be finished if the field is not in focus anymore. So even a click outsite of the browser will finish the editing.

row-edit.PNG

And exacly at this point I would like to receive any event. The 'actions-edit' does only fire when using the type

actions ['edit'] and the user is clicking on the pen. Did i get anything wrong?

- Stefan

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Stefan,

   Nope you have it all right. There is just currently no event that I am aware of that fires after a field has been edited. In many of my widget I include a custom copy of SimpleTable so that I can add additional features or events.

0 Kudos
StefanP__Jung
Occasional Contributor

Thanks Robert, so i guess the best way is to use a custom copy of SimpleTable which is located within my Widget.

Maybe there will be some more events in a future version of the SimpleTable. It also would be nice if there is a github for sharing the modified 'jimu/dijit's

- Stefan

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Stefan,

   Correct, I normally include the SimpleTable in my settings folder and then just add the appropriate require in my code.

0 Kudos