PDA

View Full Version : [FIXED] [#267] [2.3] Grid RowEditor not working in recent update.....Update button is disabled..



rthiney
Jun 05, 2013, 5:28 PM
This used to run fine, now the update button is disabled...




<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Error.aspx.cs" Inherits="WarburgPincus.Valuations.Site.Error" %><%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
public void SaveInvestment(object o, DirectEventArgs e)
{
//get the row being added and save
string json = e.ExtraParams["Values"];

}


</script>
<ext:XScript runat="server" >
<script type="text/javascript">
var Exhibit = {}; //namespace
Exhibit.Investment = (function(){
return{
//Public members
addInvestment : function () {
var grid = #{gridInvestmentCapital};
grid.editingPlugin.cancelEdit();


// Create a record instance through the ModelManager
var r = Ext.ModelManager.create({
PortfolioCompanyId:1,
FundId:2,
DateOf: new Date(),
Activity: '',
Description: '',
Amount: 0,
}, 'Investment');


grid.store.insert(0, r);
grid.editingPlugin.startEdit(0, 0);
},
removeInvestment:function () {
var grid = #{gridInvestmentCapital},
sm = grid.getSelectionModel();


grid.editingPlugin.cancelEdit();


var recs=sm.getSelection();
recs.forEach(function (r)
{
App.direct.DeleteInvestment(r.data.ExInvestedCapit alId);
});
grid.store.remove(sm.getSelection());
if (grid.store.getCount() > 0) {
sm.select(0);
}
}
}
})();
</script>
</ext:XScript>


<!DOCTYPE html>


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<ext:ResourceManager runat="server" ID="Resource1" Theme="Neptune">
</ext:ResourceManager>


<form id="form1" runat="server">
<ext:GridPanel runat="server" ID="gridInvestmentCapital" Height="400" Border="false" Hidden="false">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button ID="btnAddInvestment" runat="server" Text="Add Invesment" Icon="MoneyDollar">
<Listeners>
<Click Fn="Exhibit.Investment.addInvestment" />
</Listeners>
</ext:Button>
<ext:Button ID="btnRemoveInvesment" runat="server" Text="Remove Invesment" Icon="MoneyDollar" Disabled="true">
<Listeners>
<Click Fn="Exhibit.Investment.removeInvestment" />
</Listeners>
</ext:Button>
<ext:Button ID="Button3" runat="server" Text="Preview" Icon="Eye">

</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Store>
<ext:Store
ID="storeInvestmentCapital"
runat="server"
RemoteSort="true"
PageSize="100">
<Model>
<ext:Model ID="Model1" runat="server" IDProperty="ExInvestedCapitalId" Name="Investment">
<Fields>
<ext:ModelField Name="ExInvestedCapitalId" Type="Int" />
<ext:ModelField Name="PortfolioCompanyId" />
<ext:ModelField Name="FundId" Type="Int" />
<ext:ModelField Name="DateOf" Type="Date" />
<ext:ModelField Name="Activity" Type="string" />
<ext:ModelField Name="Description" Type="String" />
<ext:ModelField Name="Amount" Type="Float" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:DateColumn ID="DateColumn1" runat="server"
Text="Date"
DataIndex="DateOf"
Format="MM/yyyy"
Width="75">
<Editor>
<ext:DateField ID="DateField1"
runat="server"
AllowBlank="false" EmptyText="Need a date."
Format="MM/yyyy"
MinDate="01.01.2006"
MinText="Can not have a start date before the Company existed."
MaxDate="<%# DateTime.Now %>"
AutoDataBind="true" />
</Editor>
</ext:DateColumn>
<ext:Column ID="Column2" runat="server" DataIndex="Activity" Text="Invesment Activity" Width="150">
<Editor>
<ext:ComboBox runat="server" ID="cmboActivity" EmptyText="Select Activity" TypeAhead="true" QueryMode="Local" Editable="true"
DisplayField="Activity" ValueField="Activity" MinChars="1" MatchFieldWidth="false">
<Store>
<ext:Store runat="server" ID="storeActivity">
<Model>
<ext:Model ID="Model4" runat="server">
<Fields>
<ext:ModelField Name="Activity" Type="string" Mapping="Activity" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:ComboBox>
</Editor>
</ext:Column>
<ext:Column ID="Column3" runat="server" DataIndex="Description" Text="Description" Flex="1">
<Editor>
<ext:TextField ID="TextField1" runat="server" AllowBlank="false" EmptyText="Enter description here..." BlankText="Must enter a description" />
</Editor>
</ext:Column>
<ext:NumberColumn ID="NumberColumn1"
runat="server"
Text="Investment"
DataIndex="Amount"
Format="$0,0">
<Editor>
<ext:TextField ID="NumberField1"
runat="server"
AllowBlank="false"
MaskRe="/[0-9\-\$\.]/" />
</Editor>
</ext:NumberColumn>
</Columns>
</ColumnModel>
<Plugins>
<ext:RowEditing ID="RowEditing1" runat="server" ClicksToMoveEditor="1" AutoCancel="false" SaveBtnText="Add Investment" ErrorSummary="false">
<DirectEvents>
<Edit OnEvent="SaveInvestment" Success="#{gridInvestmentCapital}.getStore().commitChanges( );">
<EventMask Msg="Saving.." MinDelay="0" ShowMask="true" />
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{gridInvestmentCapital}.getRowsValues( {selectedOnly : true}))" Mode="Raw" />
</ExtraParams>
</Edit>
</DirectEvents>
</ext:RowEditing>
</Plugins>
<Listeners>
<SelectionChange Handler="#{btnRemoveInvesment}.setDisabled(!selected.length );" />
</Listeners>
</ext:GridPanel>
</form>
</body>
</html>

Vladimir
Jun 05, 2013, 6:32 PM
It is known bug, please see
http://www.sencha.com/forum/showthread.php?265173-Row-Editor-not-reacting-to-field-changes-correctly

That thread contains override which fix the issue

rthiney
Jun 05, 2013, 6:49 PM
It is known bug, please see
http://www.sencha.com/forum/showthread.php?265173-Row-Editor-not-reacting-to-field-changes-correctly

That thread contains override which fix the issue


Any idea when it will be fixed in trunk?

Baidaly
Jun 05, 2013, 9:35 PM
Hello!

We cannot provide any information when this bug will be fixed. However, it seems to be a serious bug so I think Sencha will fix it soon.

Temporarily, you can use workaround from the following threads:
http://www.sencha.com/forum/showthread.php?265173
http://www.sencha.com/forum/showthread.php?264529

We have created an issue to track this defect: https://github.com/extnet/Ext.NET/issues/267

Daniil
Jun 11, 2013, 6:02 AM
This bug looks to be a show stopper for RowEditing.

So, we committed the fix to the SVN trunk, revision #5194.