checkbox disappears in custom field-extension

checkbox disappears in custom field-extension

VolkhardVVolkhardV Posts: 20Questions: 5Answers: 0

1) at https://customer.vogeler-ag.de/vag/test/test2.html is a demonstration
2) you can mark the 1st record "Name1" and goto "Ändern". In editor-form you see the fields Name and Mitglieder
3) Mitglieder is the custom field-extension which shows a 2-column-table "Billable" and "Amount"
4) when you click on a checkbox in column "Billable" this checkbox disappears.
5) when you clock the chekbox in the other row the old chekbox appears - but unchecked evertime.

Do you know why? Can anyone help?

best regards

Volkhard

Answers

  • allanallan Posts: 56,819Questions: 1Answers: 9,029 Site admin

    Nice to see a custom field type :)

    I think you've got a clash between these two:

                            $('#Members').on('click',
                                'tbody td',
                                function(e) {
                                    conf.pmEditor.inline(this,
                                        {
                                            onBlur: 'submit',
                                            submit: 'all'
                                        }
                                    );
                                });
    
                            //conf.memberTable.button().add(0, { extend: "create", editor: conf.pmEditor });
                            $('#Members').on('change',
                                'input.editor-active',
                                function() {
                                    try {
                                        conf.pmEditor
                                            .edit($(this).closest('tr'), false)
                                            .set('billable', $(this).prop('checked') ? true : false)
                                            .submit();
                                    } catch (e) {
                                        alert('change:' + e);
                                    }
                                });
    

    You want to apply the inline editing to the second column only - not the first. See this example.

    Allan

  • VolkhardVVolkhardV Posts: 20Questions: 5Answers: 0

    Hello Allan,
    i like the custom field type feature! it allows a lot flexibility :)
    thanks for your help! i now out-commented lines 1-10 - but now the behaviour of the checkboxes is not correct. the checkvbox in row 1 i can uncheck - but not check it again. the checkbox in row 2 i can´t check,
    the new version is online at the same place.

    do you have an idea?

    best regards

    Volkhard

  • allanallan Posts: 56,819Questions: 1Answers: 9,029 Site admin

    Hi Volkhard,

    Could you add:

    options:   [
       { label: '', value: true }
    ]
    

    to your billable checkbox field definition?

    Thanks,
    Allan

  • VolkhardVVolkhardV Posts: 20Questions: 5Answers: 0
    edited December 2021

    Hello Allan,
    thanks for the hint.

    i added and deployed online - but it doesn´t have an effect. the symptom is still the same ...

    do you have an idea?

    best regards

    Volkhard

Sign In or Register to comment.