how to fix validate some values in material ui table in reactjs and to validate some newly added table values - reactjs

I'm doing a mini task on React.js in that I have used material UI table and gave values through states and I wrote a onChange handler to edit that states.
If I click edit button all the states are changed to empty and if I click a new button new table is adding but I cant validate it, so how do I validate for the new tables and for the existing ones?
You can see my code here.
I expected output should be if i click name only it should change name but not all fields and if click add new table should be added and that should be validated.

Upon Analyzing the code, updated the fixes in the code sandbox. We need to update state when clicking 'edit' and '+' icon.
https://codesandbox.io/s/still-water-rpwnl

Related

React Bootstrap Table show and update

I am able to get a react bootstrap table to show with hard coded values, but I am trying to get it to show on a button click and display values based on a parameter. Also, on a button click can I update that same table?

Add/Edit row in table using react and redux

I’m new to react&redux and trying to build app using react-redux and I need help. When I click on add new person the form shows up, when I fill the form and click save button the values from the form (name, job title, phone, birthday) should be added to the table, and operations are always the same for everything(the value of operations row is "default" two buttons edit and delete ). I try to create reducer that will get the values from the form and add it to the table but I didn't achieve that. I don’t know how to define reducer so that happened when I click save button. Can someone help me how to solve this? Thank you. Here is the link of the project.
https://codesandbox.io/s/condescending-hill-0xiht

Antd table expand row and place textarea inside

I am trying to implement row editing with Antd where when I click on the Edit link the row expands and has a textarea inside the user can type into. I haven't been able to figure out how to trigger row expansion (didn't see any onclick event handlers on the + sign) nor how to get access to the expanded row element to slide a form field in there in a non hacky way.
This is the current code - https://gist.github.com/llevar/8f9a68bcc15ab0e37defb14a5126c5ad. The goal is to have the column "Configuration" with JSON in it end up in a text area upon clicking Edit.
Thanks in advance.
Did you try
onExpandedRowsChange props and onExpand they give you access to the expanded row callback and expanded row change.
edit:
I haven't try this, but I think you should be able to programatically expand rows with expandedRowKeys and state. and use the expandedRowRender to conditionally render "view mode" and "edit mode(text area)", also you can add a save button to save the textarea values and turn it back to "view mode"
onExpand is trigger when you press the + icon (or expand the row via rowClick)

Passing Selected Item & Input Value from Angular UI Bootstrap Dialog

I'm trying to add an input field along with a drop down in an Angular Bootstrap Dialog box and am just not getting it. When a certain item is selected from the drop down an input field will display where the user will enter in the amount. For now I want to just try passing the value from the input box back from boostrap.dialog.js to postReasonsController.js. The reasons are pulling from one table and the input value will be stored in a separate table along with the selected reason id. This is an inherited project that I did not create so I'm a bit of a newb learning off the side of my desk.
EDIT
I've added sample code to plnkr http://plnkr.co/edit/oJdax2LhlKWxSpRkH0fq?p=preview. In the sample code I ended up using
vm.currentTransaction.ReasonDiscrepencyAmount = document.getElementById('amount').value;
Which works there as well as when running it locally. However, adding the same in my actual code it doesn't work. I'm not sure why it works in my sample code but not in my application.
Can anyone see what the issue is?

create simple form with AngularJS+Bootstrap+grid

I am working on AngularJS and Bootstrap. I am new to both. I wanted to create one form which include firstname input textbox,lastname input textbox , city dropdown and add button called addUser.
When I click the add user button it should be saved in our database and then displayed in below grid with edit and delete button. When I click the edit button, all record comes under above corresponding textbox. I have gone through below link but i didn't get my scenario implementation, in that they used xeditable.
http://vitalets.github.io/angular-xeditable/
Here is an form example made with angular link
Basicly you need to create a controller. In your controller create a user object, bind this object properties to form contollers with ng-model. When user clicks a button send user object to a method in your controller, add ng-click to your buttons. In your functions, you can do create, edit, delete actions.
Please refer the link and check the highlighted keywords, this must cover all of your needs.

Resources