Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
375
updating igGrid data programmatically
posted

I am having a difficult time figuring out how to update my iggrid data programmatically.

I am developing a MVC4 application and I initially set my iggrid (let's call it grid1) in my razor view using the MVC wrapper's DataSourceURL method. My grid renders and displays my data fine.

My grid1 contains 5 columns: 3 bound columns from my model (ProductName, Description, Price) and two unbound columns (Tax and TotalTax). The TotalTax column has a formula (CalcTotalTax) attached to it which simply displays the Tax * Price. 

What I am trying to achieve is I have an igTextEditor also on the view that the user will enter their local Tax rate into. I have added a client side event to the valueChanged event of this igTextEditor (let's call it text1). I want to be able to take this tax rate and put it into each row of the grid1's Tax column. I then want the TotalTax field to automatically run its formula to determine the total tax. I can't seem to figure out the jQuery syntax to properly insert the tax rate into each row of my grid1. I just want the user to be able to enter in various tax rates and be able to see what the corresponding total tax would be for each product that is listed in the grod (it could hundreds of rows).  I'm assuming this is possible but perhaps someone can shed some more light on this for me, I'm still learning Ignite, MVC and jquery!

Thanks.

Rosco

 

<script type="text/javascript">

function CalcTotalTax(row, grid) {

return row.Price * row.Tax;

 }

function SetTax(evt, ui) {    

**put the ui.value into each Tax column of each row in grid1 **

    }

</script>

        @(Html.Infragistics().TextEditor()

        .ID("text1")

        .AddClientEvent("valueChanged", "SetTax")

        .Width(50)

        .Render())

Parents Reply Children
No Data