Mar 26, 2013, 10:36 AM
[CLOSED] Items in comboBox should be loaded when user clicks
Hi,
On Page load the combobox should be loaded empty. When the user clicks then the items should be fetched. I tried with QueryMode="Remote" and PageProxy as well. Here is the code. Can someone help here?
On Page load the combobox should be loaded empty. When the user clicks then the items should be fetched. I tried with QueryMode="Remote" and PageProxy as well. Here is the code. Can someone help here?
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ComboboxRemote.aspx.cs"
Inherits="EXTdotNetV2.ComboboxRemote" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager runat="server" ID="ResourceManager1">
</ext:ResourceManager>
<div>
<ext:MultiCombo runat="server" ID="MultiCombo1" QueryMode="Remote">
<Store>
<ext:Store ID="Store1" runat="server">
<Proxy>
<ext:PageProxy DirectFn="App.direct.CreateDataTable">
<Reader>
<ext:JsonReader />
</Reader>
</ext:PageProxy>
</Proxy>
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="Fruit_NAME">
</ext:ModelField>
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:MultiCombo>
</div>
</form>
</body>
</html>
Codebehindusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
using System.Data;
using System.Data.OracleClient;
using System.IO;
namespace EXTdotNetV2
{
public partial class ComboboxRemote : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// DataTable dtstore = CreateDataTable();
}
public DataTable CreateDataTable()
{
DataTable dt = new DataTable();
dt.TableName = "Fruits";
dt.Columns.Add("Fruit_NAME");
dt.Rows.Add("Apple");
dt.Rows.Add("Apricot");
dt.Rows.Add("Mango");
dt.Rows.Add("Monkey");
dt.Rows.Add("Money");
dt.Rows.Add("Gauva");
return dt;
}
}
}
Last edited by Daniil; Apr 02, 2013 at 4:07 AM.
Reason: [CLOSED]