Hi, I'm using Ultrawebgrid for my applcation:
I'm using a textarea for listing the errors in my application in the RowEditTemplate when the user clicks that particular row...
So I need to have texarea only when there are any errors..... otherwise when there are no errors i dont even want the row_template to pop up..... I'm using IE6.
I'm checking if there are any errors using javascript.so I had to use the javascript event handler::*UltraWebGrid1_BeforeRowTemplateOpenHandler(gridName, rowId, templateId)*
where in I write the statements given below:document.getElementById("TextArea2").style.visibility="collapse" inside the above event function
1) it's showing javascript error as "Couldnot get the visibility property:Invalid Argument" but the row template does not pop up....... only the error's coming....
2) Is there any code to block the row template when there are no errors.?? i mean no pop_up for no errors
3) I need the error messages to be visible in the text area only when the particular row is selected... otherwise when clicks/selections happen in any other place,errors shod disappear........
Can u provide some code snippets???????
Can sum1 reply to this? URGENT....
Hello,
It seems that you want to open the edit template only on specific condition.
You can achieve this simply by returning true from the BeforeRowTemplateOpenHandler event handler on your conditions. You can handle this in event in following way.
function UltraWebGrid1_BeforeRowTemplateOpenHandler(gridName, rowId, templateId)
{
var isError = isErrorOccured(); //Identify you error condtion here
if(!isError)
return true;
}
Above code will not open pop up at all.
Remember that you can use return true to cancel any Infragistics client side event.
Further to that, are you sure that is document.getElementById("TextArea2") returning an object? Otherwise you can try document.getElementById("<%= TextArea2.ClientID %>") as follow.
document.getElementById("<%= TextArea2.ClientID %>").style.display = "none";
Please let me know if this helps you.
Hi,
Is your error stored in any of the grid’s column for all the rows seperately?
If yes then you can manage it in BeforeRowTemplateOpenHandler event handler only in following way.
var row = igtbl_getRowById(rowId);
var errorColumnKey = "ErrorCol" ;//Columnname of your error column
var errorValue = row.getCellFromKey(errorColumnKey).getValue();
var txtArea = document.getElementById("<%= TextArea2.ClientID %>");
if (errorValue != null)
txtArea.innerHTML = errorValue;
txtArea.style.display = "block";
else
txtArea.innerHTML = "";
txtArea.style.display = "none";
Otherwise please provide more information about where are you storing errors.
Let me know if this works for you.
Regards,
HBA
hi .thnks for ur reply.........
the text area I was talking in the just above post is the one i 've below the grid .Basically I've two ways where i show the errors for any row in the grid.....
1) a textarea inside a row template ... so when user double clicks the row, the row template pops up showing the errors in tht Texarea (say for e.g. txtarea1)
2) a textarea (say for e.g txtarea2) below the grid. so when a user clicks(single click) the errored row, the errors should appear in tht textarea.......
CONSIDER only Point 2 as mentioned above::::
After the error is displayed in the txtarea2.... now If i click somewhere (say a button) other than the row in the grid, the error should go off....
I mean only and only when the (errored)row is clicked, the errors should be displayed in the txtarea2 when we click somewhere else the errors displayed should go off and txtarea2 shouldn't appear!!!!
Sry for the change in the qustin......
Can u help in this?/
Sure, I can try.
It seems that the text area 2 displays error detail when specific row is selected (clicked) if that row contains error. The text area 2 should contain the error detail and remain visible till the row is selected. Is this correct?
Based on above assumption we need to clear text area 2 and make it hidden when user selects any other row or row gets unselected.
So we need to identify the place where you get another event like click on other row.
I think this can be handled in the code where you set the value of text area 2.
Or could you explain exact scenario? Which are the events where you want to clear and hide the text area 2? That would helpful for analysis.
I have sent you a request to be friend. Could you please accept? You may get my email address there.
I've sent u the mail HBA sumtime back..... I dint get any reply so far.....
and also take a look at this post tooo: http://forums.infragistics.com/forums/p/25705/94260.aspx#94260
I have read it and replied it using "Start conversation".
Do you send mail using the same or should I use some other option? Please inform.
Did you get my old messages?
Could you send a sample?
thnks for ur reply ..... but it 's not workin still HBA....... still the error's being displayed :(.
also plz look over into the post too. Urgnt
Try following code.
function UltraWebGrid1_AfterRowActivateHandler(gridName, rowId)
var textArea1 = document.getElementById("<%= TextArea1.ClientID %>");
textArea1.style.display = 'none';
textArea1.innerHTML = '';
//what is errorDiv?
/* var errorDiv = document.getElementById('Error Div ID');
errorDiv.style.display = 'none';
errorDiv.innerHTML = '';
*/
form1.TextArea1.value =""; // This textarea is the one below the grid
var band = igtbl_getBandById(rowId);
// alert(row.getCell(error_cell).getValue());
if (row.getCell(error_cell).getValue() != null)
//errorDiv.style.display='inline';
textArea1.style.display='inline';
textArea1.innerHTML = row.getCell(error_cell).getValue();
I am looking into the other post now.
hey,
i tried with innerHTML tooo...... but it's not working..... still txtarea2 is visible with the errors when i click somwer (other than the row.. i.e. deslect that row).........
can u think of any other solution???
and please resend (wat u send thro 'start conversation') by replying here....
and i gave u another link (another post) ... Can u take a look of tht too and help...????
I also used "Start Conversasion" only. I also dont know any other option.
I suggested to use textArea.innerHTML instead of textArea.value.
The code looks ok. Just try innerHTML part and let me know if it works.