2つの項目でコンボボックスを作成したいと思います。項目のテキストには、異なる形式のDateTime.Now
が表示されます。コンボボックスは、行展開にあります。c#ext.net:コンボボックスの項目をコードの後ろに挿入する
<ext:ComboBox runat="server" ID="cmbFormatFFC" DataIndex="DateFormat" FieldLabel="Date Format" Width="400" ForceSelection="true" EmptyText="Select date format...">
<Listeners>
<BeforeRender Handler="#{DirectMethods}.fillComboDates()" />
と分離コードで:ここではコンボのコードである
[DirectMethod]
public void fillComboDates()
{
cmbFormatFFC.Items.Insert(0,new Ext.Net.ListItem(DateTime.Now.ToString("d/M/yyyy"), "d/M/yyyy"));
cmbFormatFFC.Items.Insert(1,new Ext.Net.ListItem(DateTime.Now.ToString("dd-MMM-yyyy"), "dd-MMM-yyyy"));
}
は、しかし、私は、アプリケーション内の行を展開するとき、私はこのエラーを取得:
Uncaught TypeError: Cannot set property 'component' of null
それが値を返す必要がありますなぜですか? – aggicd