Tuesday, January 24, 2012

I like AJAX... and it is getting easier :P

$.ajax({

   url: '/SiliconSampleDefinition/GetLinkableDefinitions',

   type: "POST",

   dataType: "json",

   data: { id: '@(Model.SiliconSampleDefinition.Id)', query: request.term },

   success: function (data) {

      response($.map(data, function (item) {

         return {

            id: item.Id,

            label: item.DisplayName,

            firstShipDate: item.FirstShipDate,

            firstExternalShipDate: item.FirstExternalShipDate,

            lastShipDate: item.LastShipDate

         };

      }));

   }

});

No comments:

Post a Comment