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

How to pass parameter value to wcf

2 Answers 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
CCN
Top achievements
Rank 1
CCN asked on 15 Jan 2014, 12:37 PM
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 Answers, 1 is accepted

Sort by
0
CCN
Top achievements
Rank 1
answered on 16 Jan 2014, 02:22 AM
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. 
0
David Silveria
Top achievements
Rank 1
answered on 17 Jan 2014, 01:57 PM
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
Tags
General Discussions
Asked by
CCN
Top achievements
Rank 1
Answers by
CCN
Top achievements
Rank 1
David Silveria
Top achievements
Rank 1
Share this question
or