Can we have by default add item option instead clicking 'add a purchase item'

See attachment

HI @MOHAMMED ASHRAF ALI


Yes it  possible to do that, basically you need to put a "If" condition for the table record list.

now currently , when you click "Add Purchase" it will append the list item to the list ,

when the page loads , you can check the list with "if" condition , suppose it the list empty , by default you can append the list item with empty values, in this you can achieve your requirement.

I hope this helps you,

Thank you,


Regards,

Shree

Hi Mohammed,


I already worked with something similar. My solution was to have the following action in the preparation:



A local variable holdind a list will be responsible to feed your table. In the preparation you will clear that variable and check if you have results in the DB. If so, you can pass that list to the local variable. After that you check if the list is empty. If it's the case, you can assign empty values to your list and display a record with empty results.

This allow the user to have always a result even if you don´t have information in the DB. If you have, it will display the results. However, if you want to show it always you can adapt it and have a Listappend in the False branch.


I guess this can be a starting point for you.


Best regards,


João Delgado

Thanks for the quick help

Will check and advise if it worked


Srinivas K Singadi wrote:

HI @MOHAMMED ASHRAF ALI


Yes it  possible to do that, basically you need to put a "If" condition for the table record list.

now currently , when you click "Add Purchase" it will append the list item to the list ,

when the page loads , you can check the list with "if" condition , suppose it the list empty , by default you can append the list item with empty values, in this you can achieve your requirement.

I hope this helps you,

Thank you,


Regards,

Shree



Srinivas K Singadi wrote:

HI @MOHAMMED ASHRAF ALI


Yes it  possible to do that, basically you need to put a "If" condition for the table record list.

now currently , when you click "Add Purchase" it will append the list item to the list ,

when the page loads , you can check the list with "if" condition , suppose it the list empty , by default you can append the list item with empty values, in this you can achieve your requirement.

I hope this helps you,

Thank you,


Regards,

Shree

Hi Shree, thanks for your inputs. We tried with empty list, but you can see below image


but we want below result.

When I click on row then we are getting exact result that we are looking. What next we need to do?
Waiting for your kind response.

Arvind Kumar wrote:

Srinivas K Singadi wrote:

HI @MOHAMMED ASHRAF ALI


Yes it  possible to do that, basically you need to put a "If" condition for the table record list.

now currently , when you click "Add Purchase" it will append the list item to the list ,

when the page loads , you can check the list with "if" condition , suppose it the list empty , by default you can append the list item with empty values, in this you can achieve your requirement.

I hope this helps you,

Thank you,


Regards,

Shree

Hi Shree, thanks for your inputs. We tried with empty list, but you can see below image


but we want below result.

When I click on row then we are getting exact result that we are looking. What next we need to do?
Waiting for your kind response.


Anyone have any idea on above issue?

Hi MOHAMMED ASHRAF ALI and Arvind Kumar,

You may want to consider forcing a click on the "Add a purchased item" link after the table is rendered (via JavaScript). I'm not sure if it has a specific class or id, you will need to inspect the generated HTML/JS to determine that...

Hope this helps!

Hello Arvind

Are you working with Mohamed? 

You want to mimic the Editable Table behaviour,. This is not 100% possible, as the Editable table, being a system component, is worked in a way you can't fully reproduce with Table Records (the automatically appearing of inputs for the fields being shown). 

I recommend to avoid messing with the table records and instead, use a modal to add/edit the record. 

If you want to enable ADD as the only option (no EDIT), in thr same way as the Edutable Table, just put the code and inputs to add a record at the end of the table. 

If you want the Edit feature, you will have to add a way to exchange thebexpressions for inputs, and if you eant it to be exactly like the Editable table, you will need to put a layer above the line being edited, what will be abnoying, at least. 

In any case, you will have to implement this for each table you want this behaviour. 

Cheers.