appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.17k stars 3.7k forks source link

[Feature]: Optimization of JSON form controls #29716

Open QiGeMingZiZhenFeiJin opened 10 months ago

QiGeMingZiZhenFeiJin commented 10 months ago

Is there an existing issue for this?

Summary

1、JSON form can hide the submit button 2、The reset button of JSON form can customize the onclick event 3、JSON form allows you to drag buttons onto the form by yourself

Why should this be worked on?

I want to use JSON Form to dynamically add input boxes, but the combination of reset and submit buttons does not meet my needs。If I add a custom onclick event for the reset button, it will meet my needs

Nikhil-Nandagopal commented 10 months ago

@QiGeMingZiZhenFeiJin you can fork this app to dynamically add inputs using a list https://app.appsmith.com/app/input-widget/dynamic-inputs-624c647651a8863d6c402981 You can also try visually hiding the submit button by making it's color white and wrapping it in a container with it's own submit button

QiGeMingZiZhenFeiJin commented 10 months ago

@Nikhil-Nandagopal Hello, I have tried this method before, using a list control, but I couldn't get the input value from the input. Do you have any good methods?

Nikhil-Nandagopal commented 10 months ago

@QiGeMingZiZhenFeiJin you should be able to access it using {{List1.triggeredItemView.Input1}} or {{List1.currentItemsView}} to access all list items

QiGeMingZiZhenFeiJin commented 10 months ago

WX20231219-215450@2x 222 @Nikhil-Nandagopal Excuse me again, I have encountered the following two issues:

  1. Adding new controls to the list using buttons may sometimes not be fully displayed.
  2. The content of the input text boxes is the same, which may be due to an issue with the array I wrote. Can you provide the correct JavaScript code for this example? https://app.appsmith.com/app/input-widget/dynamic-inputs-624c647651a8863d6c402981
Nikhil-Nandagopal commented 10 months ago

@QiGeMingZiZhenFeiJin you can hit the fork button in the example to inspect the code inside it

QiGeMingZiZhenFeiJin commented 10 months ago

@Nikhil-Nandagopal Thank you very much! I can see that I will try following the example.

QiGeMingZiZhenFeiJin commented 10 months ago

image https://app.appsmith.com/app/dynamic-input/page1-63fcb3b51a6f763bee64d648 Hello, this sample is more suitable for our project, but I have encountered a problem and would like to consult with you: it seems that this list can only retrieve the text box input data of the current page. Is it because my method is not correct? I have tried List. currentitemsView or List. selecteditemView but they cannot be implemented.Looking forward to your reply, thank you very much!

Nikhil-Nandagopal commented 9 months ago

@QiGeMingZiZhenFeiJin yes that is correct. Only the views that are currently in the view port will be shown. If you need the list to span across different pages, you can save the value of the input onTextChange in the store and read it from there. This is because views are recycled for performance so only the views in the viewport can be accessed.

QiGeMingZiZhenFeiJin commented 6 months ago

@Nikhil-Nandagopal Hello, I encountered data loss when executing SQL to save data, which was saved using a synchronization method and has not been resolved yet

QiGeMingZiZhenFeiJin commented 6 months ago
image image

Just saving data to the database through insert statements will result in data loss. The saved insert statement is not complicated, why is this? What are the solutions?

Nikhil-Nandagopal commented 6 months ago

@QiGeMingZiZhenFeiJin I don't know what you mean by data loss exactly. Could you please reach out to support@appsmith.com or our discord community for help? We'll need to debug the issue with you.