New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSharper and Metro UI #1391
Comments
This should not affect the operation of Metro 4. |
Awesome! |
Well, it is strange, because I can't see the data in the table, while the following code works for a pure html table (and also for Metro UI css/script when the reactive view of WebSharper and the above said workaround is not involved, that is only for a static server rendered page). (if Array.isEmpty trades then
p [] [text "No trades selected"]
else
Doc.Concat [
div [] [Inspector()];
table [attr.``class`` "table"; attr.``data-`` "role" "table"; attr.``data-`` "horizontal-scroll" "true"; attr.id "demo-table"] [
yield thead [] [
tr [] [
for v in headers do
match v with
| Numeric k -> yield th [attr.``class`` "sortable-column"; attr.``data-`` "format" "number"] [text k]
| Alphanumeric k -> yield th [attr.``class`` "sortable-column"] [text k]
] ]
for tup in trades do
yield tr [] [
for (k,v) in tup do
yield td [] [text <| string v]
] Are you sure that no operations of Metro 4 are affected? |
I added these methods because I use them in my projects. |
So maybe... if we deactivate thoese methods with the above JavaScript Inline from WebSharper as a workaround while constructing the page, then your project can't build the table as expected... just guessing... |
If the problem was in the Table component, then my projects would stop working for me. I am not developing for .NET, so I cannot tell you why your code does not work. |
Oh, sorry for the confusion. What I'm trying to say is that your project - in particular the Table component - works fine (actually I love the Table component and the possibility to customize it from the user side via the Inspector), but it sets some extra methods on the Array prototype and that prevents WebSharper (.Net) from building the page... I can't see a solution and I was asking your help. Don't you think that it can be a problem for an external framework that is using such Component? Is it something that affects only WebSharper? I'm sorry I'm not a JavaScript expert but I'm having the feeling that this change on the Array may have quite a broad impact... |
The Table component does not use these extensions for an array. Therefore, disabling them should not affect the operation of the component. |
OK, so, if you are right, that means that this issue is solved, but there is another unrelated issue, that at the moment I've not yet discovered, and it is likely a similar incompatibility between the Metro UI script and WebSharper. |
FYI yield tbody [] [
for tup in trades do
yield tr [] [
for (k,v) in tup do
yield td [] [text <| string v]
] ] But btw - regarding the original topic here - someone is saying that
because, they explain:
and, to be honest, on the other hand, someone else replies that
|
We have a sample of Metro UI with WebSharper in this repo.
I'm especially interested in the Table component with an Inspector.
The problem is that in a real world Production scenario I will have a client server architecture to retrieve data from the DB. Let's imagine an event from a button to fetch data from the DB
In this case WebSharper has a reactive View with a binding to a Doc.
Long story short, we have found an issue due to the fact that
Refer to the WebSharper Forum topic related to this matter.
The only workaround at the moment is due to the suggestion:
but I'm afraid it can impact the features of metro style, especially the inspector button that I should be able to click after the table is retrieved and rendered on the page (it is the first most important for choosing Metro UI in my use case).
Is there a solution?
The text was updated successfully, but these errors were encountered: