Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
fixed insertbug
Browse files Browse the repository at this point in the history
  • Loading branch information
sajrashid committed Jul 23, 2021
1 parent d88bc31 commit 45466dc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"pretty": "^2.0.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dj-table": "^1.1.5",
"react-dj-table": "^1.1.7",
"react-dom": "^17.0.2",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/components/react-dj-table/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-dj-table",
"version": "1.1.6",
"version": "1.1.8",
"description": "React Dynamic Resposive Json HTML Table",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 1 addition & 3 deletions src/components/react-dj-table/reducers/tableReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export const TableReducer = (state, action) => {
if(state.inserting){
// delete the row
state.json.splice(state.pageSize,1);
state.jsonCopy.splice(state.pageSize,1);
}
state.inserting=false
state.editing=true
Expand Down Expand Up @@ -267,12 +268,9 @@ export const TableReducer = (state, action) => {
case ACTIONS.CONFIRMINSERT:
const idColIdx = state.options.idCol ? Object.keys(state.json[0]).indexOf(state.options.idCol) : 0
const idColName = [Object.keys(state.json[0])[idColIdx]]
console.log(idColName)
if(action!==undefined && action.payload !==undefined){
if(action.payload.id!==undefined) state.selectedRow[idColName]=action.payload.id
}
console.log(state.selectedRow[idColIdx])

state.selectedRowCopy = {}
state.crudBtns.btnCancel=true
state.crudBtns.btnInsert=true
Expand Down
6 changes: 0 additions & 6 deletions src/components/react-dj-table/utils/rowGlobals.js

This file was deleted.

File renamed without changes.
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11137,10 +11137,10 @@ react-dev-utils@^11.0.3:
strip-ansi "6.0.0"
text-table "0.2.0"

react-dj-table@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/react-dj-table/-/react-dj-table-1.1.5.tgz#370cfb47ab24bcadee9d7a373f4584460c046359"
integrity sha512-mju4pB7FS/s5VOSATmEUffopnJn+bq7fcDwagjC4ZD7it15WboyUQSYBu+4fulUbgQAMxFR6AqNkHVtj2wFD2g==
react-dj-table@^1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/react-dj-table/-/react-dj-table-1.1.7.tgz#2113c6a4f9f1d1d912ef37bec92c799e3b49c2ff"
integrity sha512-BBQENv3dCZlqEXQxbC7YdLACKtTLGVGv1wS3grV+tUz8gdQBuLi2jVs884KPHEAVf0tojzTepxy3/VSs+3Mh7A==
dependencies:
core-js "^3.15.1"
lodash "^4.17.21"
Expand Down

0 comments on commit 45466dc

Please sign in to comment.