How to pass parameter value to wcf

3 posts, 0 answers
  1. CCN
    CCN avatar
    2 posts
    Member since:
    Jan 2014

    Posted 15 Jan 2014 Link to this post

    Hi experts,

    I'm new to Icenium and Kendo UI Mobile. What I'm doing is passing a value from one listview to another view. In the second view I wanted to show some other details based on the passed parameter. I tried the below but seems not working. Can anyone help????

    my html
    <!--Job Summary-->
        <div class="buttonArea">
            <input type="submit" id="logout" data-role="button" data-bind="click: onLogout, visible: isLoggedIn" class="login-button" value="Logout" />
        </div> 
        
    <div data-role="view" id="tabstrip-summary" data-title="Job Summary" data-show="showAssignJob"> 
            <div class="buttonArea">

                <ul id="jobassignList" class="list-content"
                    data-source="jobAssignData"
                    data-endlessScroll="true"
                    data-template="jobassignTemplate"
                    data-role="listview"
                    data-style="inset"  data-pull-to-refresh="true" data-fixed-headers="true">               
                </ul>      
       </div>

    </div>

    <!--Job assign template-->
        <script id="jobassignTemplate" type="text/x-kendo-template">         
            <div>    
            <a href="\#jobupdateview?jb=#:data.JobNo#" 
                class="km-listview-link" 
                data-role="listview-link">
                    <h2>Pickup: \##=data.JobNo#</h2> 
            </a>
            </div>
        </script> 

    <!--Job update-->
    <div id="jobupdateview" data-role="view" data-title="Job Update" data-show="showUpdateJob">   
             <div class="buttonArea">
                <ul id="jobUpdateList" class="list-header" data-source="jobUpdateData" data-template="jobUpdateTemplate"  data-role="listview"></ul>      

       </div>
    </div> 
       
        <!--Job Update template-->
        <script id="jobUpdateTemplate" type="text/x-kendo-template">    
         #= renderStatusTemplate(data.JobNo) #
                    <h3>Pickup: Job\# #=data.JobNo#</h3>  
        </script> 


    my js file.

    function showUpdateJob(e) {
        view = e.view;
        var jbn = view.params.jb.toString();
        alert(jbn); //value coming correctly
        var jobUpdateData = new kendo.data.DataSource(
           { 
              transport: {
                   read: {
                       url: varURL + "GetDispatchItem/TD001/OFD/" + jbn,  //here I'm passing data to wcf 
                       data: {
                           Accept: "application/json"
                       }
                   }
               },
               filter: { filters: [{ field: "JobNo", operator: "eq", value: jbn}] }

           });
       

            var jobUpdateTemplate = kendo.template($("#jobUpdateTemplate").text());

            jobUpdateData.fetch(function () {
                var jb =jobUpdateData.at(0);
                view.scrolllerContent.html(jobUpdateTemplate(item));
                kendo.mobile.init(view.content);
            });
        
    }
  2. CCN
    CCN avatar
    2 posts
    Member since:
    Jan 2014

    Posted 15 Jan 2014 Link to this post

    Please help if anyone has an answer.
    Basically I want to pass a value using href as show here,  href="\#jobupdateview?jb=#:data.JobNo#" 
    Please help... it is quiet urgent. 
  3. David Silveria
    David Silveria avatar
    234 posts
    Member since:
    May 2006

    Posted 17 Jan 2014 Link to this post

    Isn't view parameters what you need for such scenario? See here http://docs.kendoui.com/getting-started/mobile/view#view-parameters
    If not maybe this topic would shed more light: http://www.kendoui.com/forums/kendo-ui-mobile/button/passing-argument-on-data-click.aspx
Back to Top