Code Monkey home page Code Monkey logo

Comments (6)

vitmalina avatar vitmalina commented on July 30, 2024

I have noticed that in 1.1 version the selected item is not inside options, so the syntax that works would be

$('#form').w2form({
    name     : 'form',
    url      : 'server/post',
    fields: [
        { name: 'field_enum', type: 'enum', required: true,
            options: {
                items: [ 
                    { id:'0', text:'Adams, John' }, 
                    { id:'1', text:'Johnson, Peter' }, 
                    { id:'2', text:'Lewis, Frank' }, 
                    { id:'3', text:'Cruz, Steve' }, 
                    { id:'4', text:'Donnun, Nick' }
                ]
            },
            selected: [
                { id:'1', text:'Johnson, Peter' }
            ]  
        }
    ]
});

I will change it to be inside of the options in the next release.

About required: true for a w2field - this is not supported for the field. Only for the form.

from w2ui.

vitmalina avatar vitmalina commented on July 30, 2024

Fixed. Now if you download latest, this syntax is correct:

$('#form').w2form({
    name     : 'form',
    url      : 'server/post',
    fields: [
        { name: 'field_enum', type: 'enum', required: true,
            options: {
                items: [ 
                    { id:0, text:'Adams, John' }, 
                    { id:1, text:'Johnson, Peter' }, 
                    { id:2, text:'Lewis, Frank' }, 
                    { id:3, text:'Cruz, Steve' }, 
                    { id:4, text:'Donnun, Nick' }
                ],
                selected: [
                    { id:1, text:'Johnson, Peter' }
                ]  
            }
        }
    ]
});

from w2ui.

uvijaybhaskar avatar uvijaybhaskar commented on July 30, 2024

Hi Vitmalina,

This is vijay, I am using options selected inside searches like following,but it is not working please help me.

<script> var numbers =['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17']; ------ W2UI Grid Code ------ searches: [ { field: 'recid', caption: 'ID ', type: 'int' }, { field: 'lname', caption: 'Last Name', type: 'text' }, { field: 'fname', caption: 'First Name', type: 'text' }, { field: 'email', caption: 'Email', type: 'list', options: { items: people,selected : {'5'}}}, //--> Not Working { field: 'sdate', caption: 'Start Date', type: 'date' } ] </script>

Thanks,
Vijay

from w2ui.

weshprod avatar weshprod commented on July 30, 2024

Not working for me either
I'm using 1.4.3

Is there any workaround or fix to make it work ?

from w2ui.

vitmalina avatar vitmalina commented on July 30, 2024

Please provide a jsFiddle as an example.

from w2ui.

weshprod avatar weshprod commented on July 30, 2024

Hello,

Thanks for your reply.
I actually found a way around by setting the record node with the selected item to force it

Best regards

PS : By the way : great framework !

................................................................................................................

Le Responsable
Olivier SIVRIERE

................................................................................................................

WESH PROD Studio

1800
Avenue André Lasquin

74700 Sallanches
tel : +33(0)4.50.47.55.36
[email protected] - www.weshprod.com

....................................................................................
................................................................................................................

Le 7 déc. 2015 à 18:19, Vitali Malinouski [email protected] a écrit :

Please provide a jsFiddle as an example.

Reply to this email directly or
view it on GitHub.

from w2ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.