User Profile & Activity

Riendy Setiadi Member
riendy@intersoftpt.com
Page
of 19
Posted: June 15, 2011 5:31 AM

Hello Rudy,

Your question is on investigation now. I have to consult to our developer before I give you any solution further, because I found an issue here.

Anyway, to set integrated WebInput in WebGrid become readOnly or cannot edited when the check box uncheck, you should set on WebGrid OnRowSelect event. Please see snippet code bellow:

// used to set WebInput editable or unable to edit when select the row.
function WebGrid1_OnRowSelect(controlId, tblName, rowIndex, rowEl) {
            var WebInput1 = ISGetObject("WebInput1");
            var grid = ISGetObject("WebGrid1");
            var checkbox = grid.GetSelectedObject().ToRowObject().GetCells().GetNamedItem("Checbox1");
            if (checkbox.Value == true) {
                WebInput1.SetReadOnly(false);
                grid.GetSelectedObject().ToRowObject().GetCells()[2].SetForceNoEdit(false);
                return true;
            } else {
                WebInput1.SetReadOnly(true);
                grid.GetSelectedObject().ToRowObject().GetCells()[2].SetForceNoEdit(true);
                return false;
            }
        }

  

// used to set WebInput editable or unable to edit when checkBox click.
function WebGrid1_OnCheckBoxClick(controlId, tblName, colName, checkboxValue, originalCheckBoxValue) {
            var Grid = ISGetObject("WebGrid1");
            var input = ISGetObject("WebInput1");
            var checkbox = Grid.GetSelectedObject().ToRowObject().GetCells().GetNamedItem("Checbox1");
            if (checkbox.Value == true) {
                //i = 1;
                checkbox.Value == true;
                input.SetReadOnly(false);
                Grid.GetSelectedObject().ToRowObject().GetCells()[2].SetForceNoEdit(false);
            } else {
                //i = 0;
                checkbox.Value == false;
                input.SetReadOnly(true);
                Grid.GetSelectedObject().ToRowObject().GetCells()[2].SetForceNoEdit(true);
            }
        }

 
Regarding to the checkBox in IsRowChecker become smaller than normal size, there is a style inside our template. You can use normal checkBox to implement your scenario using cellTemplate, but I suggest you to use IsRowChecker.
I will let you know for the updates soon Rudy.

Thank you.
Riendy

Hi Patrick,

I just ensure that your issue is being on progress to solve. We effort to fix this issue as soon as possible.

Thank you for your patience.
Riendy

Posted: June 13, 2011 10:05 AM

Hi Kevin,

Have you ensure the view model which you created is work as expected so far ? Is it possible for you to attach a simple runable sample for me ? It would helpful for me to trace where is the problem.

I think to check using textblock, you should add ElementName. In example:

<TextBlock Text="{Binding FKTeamID, ElementName:UXComboBox1, Mode=TwoWay}"></TextBlock>


Thank you.
Riendy

Hi Questica,

Our developer still work hard to finish SP1 package. We hope this week we'll be ready to release SP1 package.


Thank you for your patience.
Riendy

Posted: June 13, 2011 2:31 AM

Hello Rudy,

There is a way to trigger a javascript function when the checkbox is Checked/ticked using ClientSideEvent on event "OnCheckBoxClick". But before use this way, ensure that you have set the checkbox column "Is row checker column" to true. 

 Follow this step to set the checkbox column "Is row checker column" to true :

  1. Right click on WebGrid then select "WebGrid .NET designer..."
  2. Select "Advanced" menu.
  3. Expand the RootTable and select Columns.
  4. Choose the checkBox column, then check/tick on "Is row checker column" check box.
  5. Or Set IsRowChecker property to "True".
  6. Then select apply and OK button.

Follow this step to trigger a javascript function when the checkbox checked/ticked:

  1. Expand "Layout Setting" in WebGrid property.
  2. Next, open ClientSideEvent.
  3. Add new handler on "OnCheckBoxClick".
  4. Finally, you can input a method which will triger when the checkbox checked/ticked.

Regarding to your scenario, I created a simple sample which use WebGrid. The WebGrid consist of checkbox column and WebRating (Using CellTemplate). After you follow the steps above, add snippet code bellow :

  var i; //used to initialize whether checkbox is checked or not.
        function WebGrid1_OnCheckBoxClick(controlId, tblName, colName, checkboxValue, originalCheckBoxValue) {
            var Grid = ISGetObject("WebGrid1");
            if (checkboxValue == true) {
                i = 1;
            } else {
                i = 0;
            }
        }
		
  	// To Set value on WebRating	
        function WebRating1_OnClick(controlId, newValue) {
            var WebRating1 = ISGetObject(controlId);
            var grid = ISGetObject("WebGrid1");
            var checkbox = grid.GetSelectedObject().ToRowObject().GetCells().GetNamedItem("Checbox1");
            if (checkbox.Value == true) {
                if (i == 1) {
                    WebRating1.SetValue(newValue);
                    return true;
                } else
                    return false;
            }
            else
                return false;
        }

 

It would be help if you could capture a WebGrid (for checkbox appears shrunken), so I can fix or give a solution faster because I cannot replicate this issue. For your information, the style will be works fine on XHTML.

Attached is my simple runable sample for your scenario.


Hope this helps.
Riendy

Hi Fung,

Could you please show me which layout is not works correctly ? Perhaps you would capture it for me. Please also describe me more detail about your WebGrid version which you use, PC's environment (slow PC), and scenario to reproduce this issue ? It is very helpful for me to know details of your issue.


Thank you.
Riendy

Hi Krzysztof,

To remove/hide BatchUpdateCommands in your version (2011 R1), you have to edit the entire template manually. But in product 2011 R1 SP1, we have implement the feature to disable or hide the BatchUpdateCommand, named CanUserBatchUpdate. 


Thank you.
Riendy 




Hi Neil,

Would you please let me know which one didn't work ? Did you get an error or something ?

Attached is my simple runable sample (WebListBox - SelectedItem). Is it possible for you to take a look at  my attachment? Please let me know if it is still not answer you question.


Thank you.
Riendy

Hello Sachin,

Regarding to your sample, there is no mistake in moving column header and its data from their position to another position. But you have called a method in incorrect event. This issue show due move() method exist on preRender Event. To set the structure of WebGrid (in this case to fix the issue), you have to set (call method move()) in prepareDataBinding event. Then, to set a dataSource, I suggest to set it at InitializeDataSource event.

Attached is your sample which I modified.


Hope this helps.
Riendy 

Hello Anitha,

To clear the old values in WebCombo2 based on your scenario, I suggest you to use OnLostFocus Event in WebCombo1 ClientSideEvent.

You can follow codes bellow :

function WebCombo1_OnLostFocus(controlId) 
   {
      var WebCombo1 = ISGetObject(controlId);
      var WebCombo2 = ISGetObject("WebCombo2");           
      WebCombo2.IsDirty = true;
      WebCombo2.NeedClearList = true;
      WebCombo2.Values = null;
      WebCombo2.ClearSelection();
      WebCombo2.RefreshValueItems();
      return true;
   }

Please let me know is it works as you expect or not ?


Thank you.
Riendy

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