How to populate values to select fields in Editor form dataTables.net-editor@1.6.5??

How to populate values to select fields in Editor form dataTables.net-editor@1.6.5??

Shashidhar.nkShashidhar.nk Posts: 21Questions: 5Answers: 0
edited November 2018 in Editor

Hi All,

I am using editor-1.6.5, with custom form layout.
Form Layout is:

<div className="container addAccountCustomFormLayout">
            <div className="row">
                <div className="col">
                    <editor-field name="account_number"></editor-field>
                    <editor-field name="account_owner_name"></editor-field>
                    <editor-field name="doing_business_as"></editor-field>
                    <editor-field name="current_year_status_id"></editor-field>
                    <editor-field name="street_address"></editor-field>
                    <editor-field name="city_town"></editor-field>
                    <editor-field name="zip_code"></editor-field>
                </div>
                <div className="col">
                    <editor-field name="client_id"></editor-field>
                    <editor-field name="client_property_id"></editor-field>
                    <editor-field name="state_id"></editor-field>
                    <editor-field name="county_id"></editor-field>
                    <editor-field name="cost_center"></editor-field>
                    <editor-field name="property_type_id"></editor-field>
                    <editor-field name="legal_description"></editor-field>
                </div>
            </div>
        </div>

among these fields 'state_id', 'current_year_status_id', 'client_id', 'county_id', 'property_type_id', 'state_id' are select fields.

but If I like to edit a row in a table, these select fields not auto selecting the option of that value. why?? I am not getting. Those respective field column are in table but visibility set to false in table.

And on Change those field values are empty i.e. example-> state_id: [''] in POST/PATCH submit data. WHY??

I am building this code in a django and reactjs application.

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • Shashidhar.nkShashidhar.nk Posts: 21Questions: 5Answers: 0

    Also some times editor form opens with all fields, and some other times form opens with empty body. WHY???

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin

    but If I like to edit a row in a table, these select fields not auto selecting the option of that value. why??

    Very likely because the value that the field refers to isn't available in the list of options in the select list. I would need a link to a page showing the issue to be able to help debug it further than that.

    Also some times editor form opens with all fields, and some other times form opens with empty body. WHY???

    That's not something I've seen before. Again I would need a link to a page showing the issue. Also I would suggest updating from 1.6.5 to 1.8.1 which is (at the time of writing) the current release.

    Allan

This discussion has been closed.