totaljs / components

Components for Componentator
MIT License
87 stars 61 forks source link

j-ListForm buttons doesn't work #224

Closed Invincible83 closed 1 year ago

Invincible83 commented 1 year ago

Hi,

I figured out that the name="up" and name="down" buttons don't work. My code is from the example


    <ui-component name="listform" path="users" config="autofocus:1">

        <!-- LIST RENDERING -->
        <script type="text/html">
            <div>{{ name }}</div>
        </script>

        <!-- FORM RENDERING -->
        <script type="text/html">
            <div class="padding">
                <ui-component name="input" path="?.name" config="required:1" default="''" class="m">Name</ui-component>
                <ui-component name="validate" path="?">
                    <button name="submit"><i class="ti ti-save"></i>Save</button>
                    <button name="remove">Remove</button>
                    <button name="cancel">Cancel</button>
                    <button name="down">Down</button>
                    <button name="up">Up</button>
                </ui-component>
            </div>
        </script>

        <!-- FOOTER -->

        <script type="text/html">
            <div style="margin-top:10px"><button name="create"><i class="ti ti-plus-circle green"></i>Create new</button></div>
        </script>

    </ui-component>
    <hr />
    <ui-bind path="users" config="text:STRINGIFY(value)" style="font-family:monospace" class="block"></ui-bind>

</div>

<script>

    var users = [{ name: 'Total.js' }, { name: 'Flow' }, { name: 'jComponent' }];

</script>

Thanks

petersirka commented 1 year ago

It works in <!-- LIST RENDERING --> only

Invincible83 commented 1 year ago

Oh, thank you. How silly of me not to try that. Thank and I'm sorry for the inconvenience.

Invincible83 commented 1 year ago

Hi, sorry again.

Could you add a config option? More specifically a link to a function after move. Something like config.moved = function(). I know I could use WATCH('?.mypath') yet it doesn't feel right in this case. Considering other events have a links to the functions.

@petersirka Thank you

petersirka commented 1 year ago

@Invincible83 I think so. We will add it this week. BTW: if you know how to add it, try it.