List edit in a Data table widget

brittany_sorrel
Kilo Expert

Hi all,

I've embedded the Data table with Filter widget into a custom widget and now trying to see if it is possible to perform a list edit action on the table. I've searched through the community and haven't found anything yet.

I'm doubtful that the Data table with Filter widget will allow me to perform inline edits based on what the code was showing, but I wanted to ask if anyone has found a workaround for this limitation. Or do I need to use a different widget to be able to do inline list editing?

 

Thanks,

~britt

1 ACCEPTED SOLUTION

I put it inside the td. but there are a few other issues that I had to overcome in that the sp-editable-field directive requires a data model that you would normally get from the $sp.getForm call. But I didn't want to call that for every record in the list, so created a custom script include to give me the data I needed for each field. If you think of a better way, let me know, but here is the update set for what I did. hope that helps you.

View solution in original post

25 REPLIES 25

I tried using this with sp-widget and it worked fine for me, but I did slightly update the script, as I didn't need to put it in an array for my test purposes:

 

<div>
<sp-widget widget="c.data.list"></sp-widget>
</div>

 

var options = {
  table: "incident",
  max:"5",
  o:"sys_created_on",
  filter: "state=3",
  show_breadcrumbs: "true"
};

data.list = $sp.getWidget("editable-data-table", options);

Thanks a lot for sharing this code Jon, found it really useful for one of the applications.

 

Regards,
Mandar

Hi Jon,

This is awesome, 

I do have one q though, I have 5 of these on one page and I am looking for some uniformity. 

I say this because the title of the fields are not all the same lol 

find_real_file.png

 

I dont know where to go to change this, because when I use the config in the widget and order the fields, it doesn't change the order at all on set list 4 and or the top table. 

I am a little lost. 

Any ideas anyone? 

Thanks for this, it solved a stack of issues for me too!

Yes, I had the column issue as well and had to make some changes to the widget. I have an updated version of this that i will post here in a bit. stay tuned.

 

Attached the latest now. only tested on Jakarta and London though.

Thank you for that version on this reply, it solves that issue, are you aware you cannot dot walk to other header options? They just do not show up? I have a feeling that the portal doesn't support it, cause whenever I dot.walk to a related header the row is just blank.