Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

way-data save multiple options of select #69

Open
matpache opened this issue Jul 21, 2015 · 1 comment
Open

way-data save multiple options of select #69

matpache opened this issue Jul 21, 2015 · 1 comment

Comments

@matpache
Copy link

Dear, as I can be stored in the "way-data" a set of elements? I need to store in a select multiple options.???

generates the following structure:

way data

{
"requestFoundsTransports": {
"transports": [
{
"transport_participants": {
"[]": "20"
},
"transport_ammount": "1212",
"transport_details": "1ssssss"
}
]
}
}

and I need something like this:

way data

{
"requestFoundsTransports": {
"transports": [
{
"transport_participants": {
"[]": "20,21,23"
},
"transport_ammount": "1212",
"transport_details": "1ssssss"
}
]
}
}

or this way:

way data

{
"requestFoundsTransports": {
"transports": [
{
"transport_participants": {
"[0]": "20",
"[1]": "21",
"[2]": "22"
.......
},
"transport_ammount": "1212",
"transport_details": "1ssssss"
}
]
}
}

greeeeetings !!!!

@matpache
Copy link
Author

HTML is:

            <div class="tab-pane" id="transport">
                <h3>Transporte<a class="btn btn-small btn-default add-remove-transport" style="margin-left:5%; margin-top: 0%;"  way-action-push="requestFoundsTransports.transports"><i class="fa fa-plus"></i></a></h3>
                <div class="row" style="margin-top:0%;">
                    <div class="span2" style="margin-left:3%;"> 
                        {{ Form::label('transport_ammount','Monto') }}
                    </div>
                    <div class="span2" style="margin-left:3%;"> 
                        {{ Form::label('transport_participants','Participantes') }}
                    </div>                      
                    <div class="span7" style="margin-left:3%;"> 
                        {{ Form::label('transport_details','Detalles') }}
                    </div>
                    <div class="span1" style="margin-left:3%;"> 
                        {{ Form::label('remove','Quitar') }}
                    </div>
                </div>                      
                <div class="row" style="margin-top:0%;" way-repeat="requestFoundsTransports.transports">                    
                    <div class="span2" style="margin-left:3%;"> 
                        {{ Form::text('transport_ammount[$$key]', 0,array('class'=>'span2 sum-real-time', 'placeholder'=>'ej: 15260', 'way-data' => 'transport_ammount')) }}
                    </div>
                    <div class="span2" style="margin-left:3%;">
                        {{ Form::select('transport_participants[$$key][]', $usersServices_select2, Auth::user()->id, array('class'=>'form-control span2', 'multiple', 'data-placeholder'=>'--seleccione--', 'way-data'=>'transport_participants')) }}   
                    </div>
                    <div class="span7" style="margin-left:3%;"> 
                        {{ Form::textarea('transport_details[$$key]','',array('rows'=>2, 'class'=>'span7 transport-details', 'way-data'=>'transport_details')) }}
                    </div>
                    <div class="span1" style="margin-left:3%;margin-top:0%; width:5%;">
                        <a class="btn btn-small btn-default recalcule-sum add-remove-transport" way-action-remove="requestFoundsTransports.transports.$$key"><i class="fa fa-times"></i></a>
                    </div>  
                </div>
                <div class="row"  style="margin-top:0%;">
                    <div class="span7" style="margin-left:3%;">
                        <h4>way data</h4>
                        <pre way-data="__all__" way-json="true" way-default="{}"></pre>
                        <button class="btn btn-danger" way-clear way-persistent="true">Clear data</button>
                    </div>
                </div>
            </div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant