# Completing the Add/Edit ScholarX programs functionality

**URL:** <https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194>\
**Category:** ScholarX\
**Created:** [October 23, 2020, 1:35am UTC](https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194 "2020-10-23T01:35:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [October 23, 2020, 1:35am UTC](https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194/1 "2020-10-23T01:35:38Z")

</div>

Using the platform we must be able to achieve below requirements.

1. Add a program
2. Edit a program

I will be working on these requirements.

> <https://github.com/sef-global/scholarx-frontend/issues/24>
>
> Is your feature request related to a problem? Please describe.
> We need to bind the API with dummy modal
> Describe the solution you'd...

  

> <https://github.com/sef-global/scholarx-frontend/issues/26>
>
> Is your feature request related to a problem? Please describe.
> We need to bind the edit program view with the API so...

---

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [October 23, 2020, 2:15am UTC](https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194/2 "2020-10-23T02:15:57Z")

</div>

Here’s the PR for Add a program:

> <https://github.com/sef-global/scholarx-frontend/pull/25>

  
 ![Kapture 2020-10-23 at 07.31.34](https://global.discourse-cdn.com/free1/uploads/sef/original/1X/b3187b9f7992d7e5244656eda00ef6b8a8b0a11f.gif)

---

<div class="post-metadata">

**Author:** ![jaye](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/jaye/32/810_2.png) [@jaye](https://sef.discourse.group/u/jaye)\
**Post date:** [October 23, 2020, 4:12am UTC](https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194/3 "2020-10-23T04:12:56Z")

</div>

Thanks for the update @anjisvj! This is brilliant!

I’ve added some comments: [https://github.com/sef-global/scholarx-frontend/pull/25#pullrequestreview-515280565](https://github.com/sef-global/scholarx-frontend/pull/25#pullrequestreview-515280565)  
Feel free to contact me if you need some clarifications.

---

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [October 24, 2020, 4:53am UTC](https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194/4 "2020-10-24T04:53:34Z")

</div>

Here’s the PR for Edit a program:

> <https://github.com/sef-global/scholarx-frontend/pull/28>

 ![Kapture 2020-10-24 at 10.18.24](https://global.discourse-cdn.com/free1/uploads/sef/original/1X/8586fdb9ab85e167a6f9fb3faa636811f526f9c0.gif)

---

<div class="post-metadata">

**Author:** ![jaye](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/jaye/32/810_2.png) [@jaye](https://sef.discourse.group/u/jaye)\
**Post date:** [October 24, 2020, 8:29am UTC](https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194/5 "2020-10-24T08:29:13Z")

</div>

This is truly amazing, @anjisvj! Thanks for getting this done! 😍

---

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [October 24, 2020, 8:31am UTC](https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194/6 "2020-10-24T08:31:21Z")

</div>

Replied. [https://github.com/sef-global/scholarx-frontend/pull/28#discussion\_r511337001](https://github.com/sef-global/scholarx-frontend/pull/28#discussion_r511337001) @jaye

---

<div class="post-metadata">

**Author:** ![jaye](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/jaye/32/810_2.png) [@jaye](https://sef.discourse.group/u/jaye)\
**Post date:** [October 24, 2020, 8:45am UTC](https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194/7 "2020-10-24T08:45:02Z")

</div>

I found this peace From the Antd’s form API page,

After wrapped by `Form.Item` with `name` property, `value` (or other property defined by `valuePropName` ) `onChange` (or other property defined by `trigger` ) props will be added to form controls, the flow of form data will be handled by Form which will cause:

1. You shouldn’t use `onChange` on each form control to **collect data** (use `onValuesChange` of Form), but you can still listen to `onChange` .
2. You cannot set value for each form control via `value` or `defaultValue` prop, you should set default value with `initialValues` of Form. Note that `initialValues` cannot be updated by `setState` dynamiclly, you should use `setFieldsValue` in that situation.
3. You shouldn’t call `setState` manually, please use `form.setFieldsValue` to change value programmatically.

---

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [October 24, 2020, 8:51am UTC](https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194/8 "2020-10-24T08:51:56Z")

</div>

I added the changes. @jaye

---

<div class="post-metadata">

**Author:** ![jaye](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/jaye/32/810_2.png) [@jaye](https://sef.discourse.group/u/jaye)\
**Post date:** [October 24, 2020, 4:09pm UTC](https://sef.discourse.group/t/completing-the-add-edit-scholarx-programs-functionality/194/9 "2020-10-24T16:09:27Z")

</div>

Merged! Thanks @anjisvj!
