Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-049
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-049
2021-049
Commits
b9e812c7
Commit
b9e812c7
authored
Aug 22, 2021
by
Gihan76
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Class Institute List
parent
efb09f29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
...tcoach-frontend/src/Components/Admin/add_class_details.js
+35
-5
No files found.
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
View file @
b9e812c7
import
React
,
{
Component
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
SelectSearch
,
{
fuzzySearch
}
from
'
react-select-search
'
;
import
*
as
configs
from
"
../../Config/config
"
;
const
options
=
[
{
name
:
'
Hasitha
'
,
value
:
'
1
'
},
...
...
@@ -13,6 +14,29 @@ export default class AddClassDetails extends Component{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
instituteList
:
[
'
Sakya Nugegoda
'
,
'
Montana Kiribathgoda
'
,
'
Wasiti Kiribathgoda
'
]
}
}
// this.onChangeInstituteDropDown = this.onChangeInstituteDropDown.bind(this);
componentDidMount
()
{
axios
.
get
(
configs
.
BASE_URL
+
'
/instituteSingUp/
'
)
.
then
(
response
=>
{
if
(
response
.
data
.
length
>
0
){
console
.
log
(
response
.
data
);
this
.
setState
({
instituteList
:
response
.
data
})
}
})
}
onChangeInstituteDropDown
(
value
)
{
this
.
setState
({
newInstitute
:
value
.
target
.
value
})
}
render
()
{
...
...
@@ -52,11 +76,17 @@ export default class AddClassDetails extends Component{
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Institute
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
>
<
option
>
Select
Institute
<
/option
>
<
option
>
Sakya
Nugegoda
<
/option
>
<
option
>
Minasko
Malabe
<
/option
>
<
option
>
Rotary
Nugegoda
<
/option
>
<
option
>
Sasip
Nugegoda
<
/option
>
onChange
=
{
e
=>
this
.
onChangeInstituteDropDown
(
e
)}
<
option
value
=
""
disabled
selected
>
Select
Institute
<
/option
>
{
this
.
state
.
instituteList
.
map
((
dis
)
=>
<
option
key
=
{
dis
.
_id
}
id
=
{
dis
.
_id
}
value
=
{
dis
.
institute_name
}
>
{
dis
.
institute_name
}
<
/option>
)
}
{
/*<option>Select Institute</option>*/
}
{
/*<option>Sakya Nugegoda</option>*/
}
{
/*<option>Minasko Malabe</option>*/
}
{
/*<option>Rotary Nugegoda</option>*/
}
{
/*<option>Sasip Nugegoda</option>*/
}
<
/select
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment