This is a migrated thread and some comments may be shown as answers.

How to update fields in everlive using icenium graphite

3 Answers 54 Views
AppBuilder Windows client
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andres
Top achievements
Rank 1
Andres asked on 24 Sep 2013, 09:43 PM
im trying to update fields of a register in everlive in the main.js from the htmlview but throws me an error like "uncaught typeerror: object[objec" (and just show that) and i dont no what to do

main.js

//--------------------------------- actividad model ----------------------------------------
    var actividadViewModel = (function () {
        return {
            show: function (e) {
                var actividad = actividadesModel.actividades.getByUid(e.view.params.uid);
                kendo.bind(e.view.element, actividad, kendo.mobile.ui);
            }
        };
    }());
    
    //--------------------------------- add actividad model --------------------------------
    var addactividadViewModel = (function () {
        var $newdescripcion;
        var $newfecha_fin;
        var $newfecha_inicio;
        var $newhora_inicio;
        var $newhora_fin;
        var $newid_Cliente;
        var $newid_tipo_actividad;
        var $newidTipoTarifa;
        var validator;
        var init = function () {
            validator = $('#enterStatus').kendoValidator().data("kendoValidator");
            $newdescripcion = $('#newdescripcion');
            $newfecha_fin = $('#newfecha_fin');
            $newfecha_inicio = $('#newfecha_inicio');
            $newhora_inicio = $('#newhora_inicio');
            $newhora_fin = $('#newhora_fin');
            $newid_Cliente = $('#newid_Cliente');
            $newid_tipo_actividad = $('#newid_tipo_actividad');
            $newidTipoTarifa = $('#newidTipoTarifa');
        };
        var show = function () {
            $newdescripcion.val('');
            validator.hideMessages();
        };
        var saveActividad = function () {
            if (validator.validate()) {
                var actividades = actividadesModel.actividades;
                var actividad = actividades.add();
                actividad.descripcion = $newdescripcion.val();
                actividad.fecha_fin = $newfecha_fin.val();
                actividad.fecha_inicio = $newfecha_inicio.val();
                actividad.hora_inicio = $newhora_inicio.val();
                actividad.hora_fin = $newhora_fin.val();
                actividad.id_Cliente = $newid_Cliente.val();
                actividad.id_tipo_actividad = $newid_tipo_actividad.val();//$newStatus.val();
                actividad.idTipoTarifa = $newidTipoTarifa.val();
                actividad.UserId = usersModel.currentUser.get('data').Id;
                actividades.one('sync', function () {
                    mobileApp.navigate('#:back');
                });
                actividades.sync();
            }
        };
        return {
            init: init,
            show: show,
            me: usersModel.currentUser,
            saveActividad: saveActividad,
            saveActividadE: saveActividadE
        };
    }());



htmlView




<div data-role="view" id="single-actividad" data-layout="default" class="actividades-view" data-show="app.viewModels.actividad.show">

    <header data-role="header">
        <div data-role="navbar">
            Actividad
            <a class="nav-button" data-align="left" data-role="backbutton">Regresar</a>
            <a class="nav-button" data-align="right" data-role="button" onClick="
            document.getElementById('descripcionE').disabled=false;
            document.getElementById('fecha_inicioE').disabled=false;
            document.getElementById('fecha_finE').disabled=false;
            document.getElementById('hora_inicioE').disabled=false;
            document.getElementById('hora_finE').disabled=false;
            document.getElementById('id_ClienteE').disabled=false;
            document.getElementById('id_tipo_actividadE').disabled=false;
            document.getElementById('idTipoTarifaE').disabled=false;
            ">Editar</a>
            
        </div>
    </header>
    <div id="status-container" class="user-status-wrp" data-role="listview" data-style="inset">
        <div id="enterStatusE" class="share-form-wrp">
            <div class="user-info">

                <h2 data-bind="text: User().DisplayName"></h2>
                <!--<h2 data-bind="text: UserId"></h2>-->
                <h2 data-bind="text: me.get('data').DisplayName">Me</h2>
            </div>
            <ul id="actividad-form" data-role="listview" data-style="inset">
                <li>
                    <label for="descripcionE" style="font-size:14px; color:#FFAB00">Descripción </label>
                    <input  id="descripcionE" type="text" data-bind="value: descripcion" disabled="true"/>
                </li>
                <li>
                    <label for="fecha_inicioE" style="font-size:14px; color:#FFAB00">FechaInicio </label>
                    <input type="datetime" id="fecha_inicioE" data-bind="value: fecha_inicio" disabled="true"/>
                </li>
                <li>
                    <label for="fecha_finE" style="font-size:14px; color:#FFAB00"> FechaFin</label>
                    <input type="datetime" id="fecha_finE" data-bind="value: fecha_fin"  disabled="true"/>
                </li>
                <li>
                    <label style="font-size:14px; color:#FFAB00">
                        Hora Inicio
                        <input type="time" id="hora_inicioE" data-bind="value: hora_inicio" value="00:00:00" disabled="true"/>
                    </label>
                </li>
                <li>
                    <label style="font-size:14px; color:#FFAB00">
                        HoraFin
                        <input type="time" id="hora_finE" data-bind="value: hora_fin" value="00:00:00" disabled="true"/>

                    </label>
                </li>
                <li>
                    <label for="id_ClienteE" style="font-size:14px; color:#FFAB00">Cliente </label>
                    <input id="id_ClienteE" type="text" placeholder="Digite nombre " data-bind="value: id_Cliente" disabled="true"/>

                </li>
                <li>
                    <label style="font-size:14px; color:#FFAB00">
                        TipoActividad
                        <select id="id_tipo_actividadE" data-bind="value: id_tipo_actividad" disabled="true">

                            <option value="Asesoría Jurídica">Asesoría Jurídica</option>
                            <option value="Litigios">Litigios</option>
                            <option value="Otros">Otros</option>

                        </select>
                    </label>
                </li>
                <li>
                    <label for="idTipoTarifaE" style="font-size:14px; color:#FFAB00">TipoTarifa </label>
                    <textarea id="idTipoTarifaE" placeholder="Estandar" required validationMessage="Requerido!" data-bind="value: idTipoTarifa" disabled="true"></textarea>

                </li>
                <li>
                    <a data-role="button" data-bind="events: { click: saveActividad }">guardar</a>

                </li>

            </ul>
        </div>
    </div>
</div>

3 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 25 Sep 2013, 02:55 PM
Hi Andres,

You can try out Icenium Graphite Simulator to debug your application and find out what is the problem. You can click Debug in the simulator and then from the Sources tab add breakpoints in your JavaScript code to expect the behavior and find your issue.

Hope this helps,
sdobrev

Big news for mobile app and .NET developers! Hear about it at our Release Keynote. Thursday, September 26th, 11AM EDT
Do you enjoy Icenium? Vote for it in Windows IT Pro Community Choice Awards as Best Cloud Computing Product or Service (Category 5).
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Andres
Top achievements
Rank 1
answered on 27 Sep 2013, 02:45 PM
Thanks for help Stefan, in the debugger mode i'm trying to follow the error that throws me but i cant figure it out because he took me to the jquery library ant then to the kendo library and executes many  lines that i cant understand.... no one of these lines are commented.
if you can help to solve this problem with a function that i can use  in the code that i  provide it will be really helpful.
0
Steve
Telerik team
answered on 30 Sep 2013, 07:55 AM
Hello Andres,

There is no such thing as "debug function" that you can use. If you can't figure out where the problem lies by using the built-in debugger, you can try the old fashioned "console.log" or "alert" and place them in your code so they indicate which part of your code fails.

Regards,
Steve
Telerik
You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
Tags
AppBuilder Windows client
Asked by
Andres
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Andres
Top achievements
Rank 1
Steve
Telerik team
Share this question
or