views:

21

answers:

0

In my project i have called method WCF service which returns a result but now i am using a method which returns a list of result which i want to append to a single template. my callback function look like this:

function callbackEvent(_result){

        var result=_result;
     var title = result.Title;

  var data = result.Data;

  var s = result.DateTime.DateTime.slice(6,19);
  var n = parseInt(s);
  var d = new Date(n);
  var date = d.format("dddd, MMMM dd hh:mm tt");


  var description = result.Description.replace(/<\/?[^>]+>/gi, '');
  var keywords = result.Keywords;



  var t = new Sys.Preview.UI.Template.getTemplate($get("divdata"));
  t.createInstance($get("datashow"),
    {
        title: title,
        data: data,
        date: date,
        description: description,
        keywords: keywords
    });

I have used ajax 4.0 Sys.Preview.UI.Template class without changing that i want to append each (say 10) result in div "datashow"
my template(with class=sys-template)ie "divdata" looks like this:

    <div  id="divdata" class="sys-template" >
    <p>Event Title:<input  id="title" type="text" readonly="readonly" value="{{title}}" 
            style="width: 497px" />
        </p>    

    <p>Event Data:<input type="text" id="data" style="width: 757px; height: 170px" value="{{data}}" />
</p>

    <p>Event Description:<input type="text" id="description" value="{{ description }}"  
        readonly="readonly" style="width: 449px" /></p>

    <p>Event Date: <input type="text" id="date" value="{{ date }}" readonly="readonly" 
            style="width: 150px"/></p>
    <p>Keywords : <input type="text" id="keywords" value="{{keywords}}" 
            readonly="readonly" style="width: 231px" />


      </div>

Help me to render a list of data (ie a result which contains list of say someevents)