User Profile & Activity

Glenn Layaar Support
Page
of 99
Posted: June 7, 2010 12:01 AM

In order to cancel the command execution you will need to return false in the OnBeforeExecCommand event handler not in the OnToolBarClick event handler. Here is the snippet for OnBeforeExecCommand event handler assuming this is for Bold action command, since I do not have the ltrim and rtrim function I only use text selection:

function WebTextEditor_OnBeforeExecCommand(controlId, action)
{
var WebTextEditor = ISGetObject(controlId);
var NewMailMerge = WebTextEditor.MailMergeSettings;
var NewSelection = WebTextEditor.Selection;

//Should remove white spaces before and after the selection
var text = NewSelection.text;

switch(action)
{
case "Bold":
if (text.indexOf('}') < text.indexOf('{') ||
(text.indexOf('{') < 0 && text.indexOf('}') > 0) ||
(text.indexOf('{') > 0 && text.indexOf('}') < 0))
{
return false;
}
break;
}
}


Posted: June 6, 2010 11:43 PM

Our WebNotification is interval based not event based. However, based WebFormType.aspx and WebServiceType.aspx reference sample, we could provide a workaround for your scenario.

In the sample, the notification will only be displayed if this line is executed:

collection.Notifications = new WebNotificationEvent[] { evnt };

An event object is added to the collection, in your case you will need to add a conditional block so the event will only be added if there is a difference in Grid row count.

Based on my test using the scenario you described, it seems the issue is caused by a bug in WebGrid. A bug report has been submitted to the developer.

We will inform you if you there is any update or progress regarding this issue.

Posted: June 3, 2010 11:43 PM

Did you mean when user click on the modified header, the user will not be redirected to the day view? If so in the new DIV click event handler you will need to abort the click. Here is the snippet:

function ClickEventHandlerHeader(headerElem)
{
event.returnValue = false;
event.cancelBubble = true;
}


Here is the DeleteRow event handler for manually bound data set, I am using OleDBDataAdapter in order to fill the dataset:
void WebGrid1_DeleteRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
DataSet ds = (DataSet)WebGrid1.DataSource;
((DataRowView)e.Row.DataRow).Row.Delete();
da.Update(ds);
e.ReturnValue = false;
}
You will need to manually call the delete function for the deleted row and using data adapter to persist the change to the database. You will also need to set the ReturnValue to false for such scenario in order to avoid any further process done by WebGrid to the deleted row. 

Unfortunately, our WebFileUploader will need to save the uploaded file to the WebServer hard disk (or a path set in the UploadPath property) for further processing. Our documentation also has more explanation for this issue on article "Walkthrough: Configuring Upload Location" and "Webfarm and multiple worker requests support with built-in FileStateServer"

If you would like, you could delete the uploaded file after the business logic has been successfully executed, but the uploaded file will need to be uploaded to the hard disk first.


We are very sorry, however the bug is still active. Our WebUI Studio 2010 R1 release is delayed and currently we are preparing hotfix for the active issue before the 2010 R1 release.

I still do not have any fixed date for the hotfix release.  

Posted: June 2, 2010 10:38 PM

The issue could be replicated in my environment. This issue is caused because the clicked area is the newly added DIV, in order to resolve the issue, we will need to invoke the click event of the original area when we click the new DIV. You will need to add a new onclick event in the newly created DIV. Here is the snippet:

Listener.Add(headerElem[i], "onclick", ClickEventHandlerHeader, headerElem[i]);

During this click event handler, you will need to invoke the click for the original element, original snippet from this post:

var inProgress = false;
function ClickEventHandlerHeader()
{
if (!inProgress)
{
inProgress = true;
if (this.dispatchEvent)
{
var e = document.createEvent("MouseEvents");

e.initEvent("click", true, true);
this.dispatchEvent(e);
}
else
{
this.click();
}
}
inProgress = false;
}


Posted: June 1, 2010 11:32 PM

Currently implementing the disabled all day style in the libraries is still being discussed by our developer. However in the next hotfix build you will still need to write the snippet in the code. 

In a multiple row update scenario, you will need to set some time before invoking another Update function call. Here is the snippet, using BindtoAccessDataSource.aspx provided sample, I add a client side function to update the first 3 row of data:

function EditRows()
{
var grid = ISGetObject("WebGrid1");

//Update first 3 row
var maxLoop = 3;
var idx = 0;

var intervalObj = setInterval(function()
{
if (idx < maxLoop)
{
var selectedRow = grid.RootTable.GetRow(idx);
var cells = selectedRow.GetCells();

cells.GetNamedItem("ContactName").SetText(selectedRow.GetCell("ContactName").Text + " " + idx, true);
cells.GetNamedItem("Region").SetText("Region #" + idx, true);

selectedRow.Update(false);

idx++;
}
else
{
clearInterval(intervalObj);
intervalObj = null;
}

}, 500);
}

Another suggestion would be to use WebGrid BatchUpdate feature, by setting AllowBatchUpdate = "true" under LayoutSettings and invoking AcceptAllChanges after updating all the rows. Here is the snippet:  

function EditRowsV2()
{
var grid = ISGetObject("WebGrid1");

//Update first 3 row
for (var i = 0; i < 3; i++)
{
var selectedRow = grid.RootTable.GetRow(i);
var cells = selectedRow.GetCells();

cells.GetNamedItem("ContactName").SetText(selectedRow.GetCell("ContactName").Text + " " + i, true);
cells.GetNamedItem("Region").SetText("Region #" + i, true);

selectedRow.Update();
}

grid.AcceptAllChanges();
}


All times are GMT -5. The time now is 5:34 PM.
Previous Next