Race condition fix for Account Plan

This commit is contained in:
Rick Falkvinge
2015-03-17 15:47:29 +01:00
parent e1fa3156a1
commit 4109a73674
3 changed files with 12 additions and 7 deletions
@@ -2,12 +2,15 @@
<script type="text/javascript">
$(document).ready(function () {
$('#<%=this.ClientID %>_DropBudgets').combotree({
$('#<%= this.ClientID %>_DropBudgets').combotree({
animate: true,
height: 30,
onLoadSuccess: function() {
$("#<%= this.ClientID%>_SpanBudgets span.combo input.combo-text").val("<%=Resources.Global.Global_DropInits_SelectFinancialAccount%>");
<%
onLoadSuccess: function () {
<%
if (!SuppressPrompt)
{
Response.Write ("$('#" + this.ClientID + "_SpanBudgets span.combo input.combo-text').val(\"" + Resources.Global.Global_DropInits_SelectFinancialAccount + "\");");
}
if (!String.IsNullOrEmpty(this.OnClientLoaded))
{
Response.Write(this.OnClientLoaded + "();");
@@ -18,6 +18,8 @@ namespace Swarmops.Controls.Financial
public AccountListType ListType { get; set; }
public bool SuppressPrompt { get; set; }
protected string DataUrl
{
get
+3 -3
View File
@@ -478,7 +478,7 @@
function setAccountTreeText (text) {
var accountTree = $('#<%=DropParents.ClientID %>_DropBudgets');
var currentText = accountTree.combotree('getText');
if (currentText.length < 3) {
if (currentText.length < 3 && parentAccountName.length > 2) {
accountTree.combotree('setText', parentAccountName);
$('span#<%= DropParents.ClientID %>_SpanBudgets span input.combo-text').css('background-color', '#FFF');
} else if (!accountTreeLoaded) {
@@ -521,7 +521,7 @@
});
}
ac
function onAccountTreeLoaded() {
var accountTree = $('#<%=DropParents.ClientID %>_DropBudgets');
// accountTree.combotree('select', 0); // clear any previous selection
@@ -604,7 +604,7 @@
<DialogCode>
<h2 id="HeaderModal"><asp:Literal ID="LiteralHeaderEditingAccount" runat="server"/></h2>
<div id="DivModalFields" class="entryFields"><input type="text" id="TextAccountName" />&nbsp;<br />
<Swarmops5:ComboBudgets ID="DropParents" runat="server" OnClientLoaded="onAccountTreeLoaded" OnClientSelect="onAccountTreeSelect" />&nbsp;<br/>
<Swarmops5:ComboBudgets ID="DropParents" runat="server" OnClientLoaded="onAccountTreeLoaded" SuppressPrompt="True" OnClientSelect="onAccountTreeSelect" />&nbsp;<br/>
<div id="DivEditProfitLossControls">&nbsp;<br/>
<Swarmops5:ComboPeople ID="DropOwner" OnClientSelect="onOwnerChange" runat="server" />&nbsp;<br/>
<input type="text" id="TextAccountBudget" style="text-align: right"/>&nbsp;<br/>