Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET
Hello,
 
I am using Sencha 'selectfield'. I want load the select field value dynamically.
 
I can able to load the data by hard code. But I am trying to load value from my .net handler page. My handler (ashx) will return as Json format. So I want read the result and I want load the data into sench selectfield control.
 
For that I am using the following code.
Ext.define('Gender', 
{
	extend: 'Ext.data.Model',
	config: 
	{
		fields: 
		[
			{
				name: 'Id', type: 'int'
			},
			{
				name: 'Gender',  type: 'string'
			}           
		]
	}
});
 

var myServiceCategory = Ext.create('Ext.data.Store', 
{
	str:'s',
	model: 'ServiceCategoryModel',	
	// proxy: 
	// {	 
		// type: 'jsonp',
		// url: 'http://localhost/MyHandlerPage.ashx',		
		// callbackKey: 'callback',		
		// scope: this,
		// reader: 
		// {
			// type: 'json'              
		// }						
    // },	
	// listeners: {			
	
    // callback : function(r, options, success) {
        // console.log(r.data)
    // },
		// load: function(store, records, success) 
		// {     	
			// console.log(store);
			// console.log(records);
			// console.log(success);			
		// },
		// exception:function(proxy, response)
		// {
			 // console.error(response.responseText);
		// }
	// },

	autoLoad: true,
	data : 
	[
		{
			Id: 1, Gender: 'Male'
		},
		{
			Id: 2, Gender: 'Female'
		},
		
	]   
});
 
From above code I can directly load the value by hard code. But I want call my .net ashx page. It is returning Json format value also. But I dont know how to get that value and how to populate the value into select field. Please find my commented line code for calling ashx page.
 
Please help me.
Posted 22-Mar-13 19:31pm
Edited 23-Mar-13 10:08am
(no name)498.5K
v2
Comments
Prasad Khandekar at 24-Mar-13 10:39am
   
Please have a look at this tutorial (http://clairespage.wordpress.com/2012/05/25/sencha-touch-2-using-proxies-stores-ajax-json-listpaging/)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 23 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100