Aside from the visualization tool used to present the data table (in my previous post here I tried also the google solution for instance), I also fail to see how to do the binding for something like a "selected row"! I've already set up my first example with a text box string and a cool, but too simple reactive view (see my github repo); now what's the way to View.Map a row selected event? I'm striving to proceed from the very basic usage to a bit more advanced code... Well, maybe I could set a reactive variable within the callback: i.e. for google charts, in the javascript select-event? Or can I use this cooler ListModel Templating approach? But without reinventing the wheel of the html table grid: just together with one of the above grids (either WebSharper.Google.Visualization or a nice Bootstrap table or a SlickGrid)

By on 2/24/2018 5:15 AM ()

wow, this works like a charm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
    let TableExample () =
        let  tdata = TableData()
        let rvText = Var.Create ""
        let view = View.FromVar rvText
        let inputField = (div [] []).OnAfterRender (fun container ->
            let visualization = new  WebSharper.Google.Visualization.Table(container)
            let options =
                TableOptions(
                    showRowNumber = true,
                    width = "600" )
            Table.Select(visualization).Add(fun () -> 
                let sel = visualization.getSelection() :?> obj[]
                let cell = sel.[0]
                let index : int =  cell?row 
                tdata.getValue(float index,float 0).ToString()
                |> Var.Set rvText
            )
            visualization.draw(tdata, options))
        let content =
            div [] [
                inputField
                textView view
            ]
        content
By on 2/24/2018 5:04 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper