When i add a node in my treeview something strange happen - jquery-ui

It is my first time that i'm asking here for some help! Sorry about my bad english, but i will try to explain my problem...
I want to add a new node to my treeview, so i'm using the 'add' options from treeview documentation, here is the code:
var tree = $('#fileTreeId').treeview({prerendered: true});
var newSublist = $('<li><span id="'+id+'" class="folder" >'+nomePasta+'</span><ul><li><span class="file"> </span></li></ul></li>').appendTo($('#fileTreeId'));
$('#fileTreeId').treeview({add: newSublist});
So, it's works fine, but in my system i have a click event that when i click on the folder i check the parent "ul" to ckeck if it is "expandable" or "collapsable", if it is "collapsable" i get by ajax the date from database...
So after explain i will tell my doubt now. When i call the function "treeview", it reverts my logic, for example, previously when i click on the folder it gives me "expandable" when the folder is closed and give me "collapsable" when the folder is open, now, after i call the function "treeview", it gives the opposite result, it is, when the folder is closed the class is "collapsable" and when the folder is open the class of parent "ul" is "expandable", anyone have any idea of what it can be?

Related

Deactivate read-only & non-realtime mode in firebase [duplicate]

Read-only & non-realtime mode activated to improve browser performance
Message pops up in my project and I'm unable to delete the nodes as well
Also I read this https://groups.google.com/forum/#!topic/firebase-talk/qLxZCI8i47s
Which states :
If you have a lot of nodes in your Firebase (say thousands), we need to create a new element for each node and modern browsers simply have limitations of how many DOM elements you can add to a page
It says:
To resolve this problem, don't load your Firebase Dashboard at the root of your Firebase, but instead load it lower down in the hierarchy
I do not get what it means
How do I get back to my Realtime Dashboard?
If you want to delete a high level node when this is activated, I recommend doing this.
Open up a text editor and type in { }. Save this file as "blankJSON.json".
Go to high level node you want deleted and select it, once it opens up and shows you all the nodes that need to be removed, select the three bars at the top right and select "Import JSON", (It would be safe to first "Export JSON" If you don't have backups, in case you make a mistake here). Import the JSON file we created earlier titled "blankJSON".
This will delete all of the data inside.
Once again, I highly suggest you make a backup before doing this, It's extremely easy to make a backup and also it is much easier than you would think to upload this blankJSON to the wrong node and then erasing a bunch of important data.
When it detects that it's downloading too many nodes from your database, the Firebase Console stops using real-time mode and switches to read-only mode. In this mode it requires less work from the browser, so it is more likely that the browser will stay performant.
To get back to realtime mode, you have to go to a location that has fewer nodes. So say that you start loading the database at the root, that means that "pseudo address bar" at the top of the data tree will say:
https://<your-project>.firebaseio.com/
And then will show the list of items. Now click on the URL in that pseudo address bar and change it to:
https://<your-project>.firebaseio.com/<one-of-your-keys>
And hit enter. The data tree will reload with just the node from one-of-your-keys and down and will likely switch to realtime mode again.
Every node key in firebase is a link, you can open a sub-node in a new tab and then edit that sub-node and its children.
Right click on a sub-node you want to edit or delete
Select open link in a new tab
Edit the sub-node in the new tab
1) Click on the Node you want to mass delete
2) Import an empty .json file (just containing curly braces, {} )
3) The node value will be set to null, in other words it is deleted or rather overridden with an empty node!
What you can do is to have an OnClickListener and call the remove value method to your DatabaseReference, like this:
mCart.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
mDatabaseReference.removeValue();
}
});
I have the same problem... I'm a bit surprised because I though Firebase could easily scale to support huge amount of data (example million users, etc.).
I have a node with 80000 sub-nodes (each object has his own push-id) and I cannot delete or perform any action on it because the real-time doesn't work in Firebase console.
I think the only way to udate or delete the data it's to do it via JAVA code :(
Multiple times trying to load the specific keys can be tiresome. There is a python library that could do this for you easily.
http://ozgur.github.io/python-firebase/
I needed to delete a lot of keys and this helped me do that in one go.
What I do is export the entire tree, edit/add the node I want using an editor, then import the JSON and overwrite the previous node/tree. Problem solved! Risky though 😁

problem with a submit and last powerApps 's folder modified in my APP

I am currently building an app with PowerApps, but i have a problem...
In fact, i would like that my app be on several screens. So in the first edit screen i use a button with the following formula :
Patch(NAME_OF_MY_SHAREPOINT_LIST,First(Filter(NAME_OF_MY_SHAREPOINT_LIST,ID = idcourant )),{balise:idcourant});SubmitForm(EditForm1);EditForm(EditForm1_1);Navigate(EditScreen1_1)
So i create and use a variable (idcourant) to modify the current folder which is the first edit screen (EditForm1) and i put this variable in the field "balise". In fact the problem is when i click on the button : the application put the user on the last modified and recorded folder of the list SharePoint...So the current folder change of ID, and this is another folder with another ID which is opended in the second edit screen:(EditForm1_1). This is a big problem for me because my application is not available for the moment and i must to deploy it very soon.... Are there any solutions ?
In fact i have found a solution : Make a submit of the first form, and then go to the next edit form.... It was so easy ... lol
SubmitForm(EditForm1);EditForm(EditForm1_1);Navigate(EditForm1_1)

Incrementing offset of Location and clicking on location

I got a problem on clicking locations. The thing I do is creating a AST from a method with the function:
getMethodASTEclipse(method, model=projectModel);
where method is just an instance of
methods(projectModel);
When I visit that tree and want to get if statements for example I can call
case i: \if(_, _, _):println(i#src);
The source will be printed and I can click on it, eclipse will go to the right class with the right if statement. The form is like this:
|project://MyProject/src/MyClass.java|(2836,143,<104,1>,<109,2>)
But when I get the AST from file with the method:
createAstFromFile(class, true);
and giving a class instaed of a method or even a file I can also visit it and get the same if statement and print it but the form of it is different and I can't click on it. Why not ?
The form of it looks like this:
|java+class:///MyClass/src/MyClass|(17938,1105,<544,4>,<570,5>)
What I also notice is that the offsets are incrementing heavily after each location is printed.
How can I make it clickable to the right location? I think it has to do something with the offset and the form of the location. I tried to use the method:
resolveJava(loc l);
from the Registry class but that didn't work either and tried to look up at declarations for the |loc definition but that wasn't there either.
Thanks in advance.
The reason the locations aren't clickable is because they cannot be resolved. The problem is that createAstFromFile(_,_) was only intended to be used with locations that have either project or file schemes.
For now, you can get the physical location from the declarations annotation in the model and use that to create the AST.
We'll look into making it so that it is possible to use locations with other schemes as well.

FastReport4: Refresh Dataset

My Report.ShowPreparedReport didn't recognize a new addition to my frxDBDataset.
So, I was building 1 report using TfrxDBDataset linked to a TVirtualTable.
Previously only 10 fields stated in Report1.fr3 and it works well.
I do the SaveAs from Report1.fr3 to Report2.fr3 in designer mode
Get back to my Delphi and add 1 new field "tec" in my TVirtualTable
Go back again in ReportDesigner (file Report2.fr3) and see that my new "tec" field is listed in Data tree.
Add the "tec" field to the report.
Preview while on designer and it was normal.
Run the program and call to preview report, it says "field 'tec' cannot be found" or something like that.
Anyone got solution?
Thanks
Please Try.
TVirtualTable.Refresh;
frxDBDataset.FieldAliases.Clear;
When you clear aliases then call Designer
FastReport automatically updates aliases.
That was the perfect solution for me.

Save Conflict Error when trying to add new List Items at the time of list creation

We have created a Custom List template programmatically using Feature.xml, Element.xml, Schema.xml AllItems.aspx, and 3 aspx forms. We have a code behind file for each of these aspx files. i.e. for the AllItems.aspx, DispForm.aspx, EditForm.aspx and NewForm.aspx.
Problematic file is AllItems.aspx. In the code behind for AllItems.aspx file we are deleting previous list items and adding new items to the list before showing them up to the user. As per expectations the code behind file for AllItems.aspx is derived from WebPartPage Class and we have tried to overload quite a few methods without much success.
Problem only occurs on the first time rendering i.e. when an instance of this list is created. When overriding OnLoad(), we get the Save conflict error, Similar is the case with OnInit(), CreateChildControls() method. However, when we override the Render() or RenderChildren() method no such error comes up but at the same time our new list items are also not visible. On browser refresh everything starts working fine as expected. It is only for the first time that the issue comes up.
What could be the possible cause for this? Any ideas, suggestions would be highly appreciated.
Best Regards,
Raghu
I had a problem with a custom EditForm.aspx. I have two lists that are linked together and a change in one causes an event handler to update the other. I have a custom control in EditForm.aspx that edits the linked list. This was causing the event handler to update the item displayed by EditForm.aspx. This in turn would cause the conflict error when the user saved the form.
I finally found that I could reset the context with:
SPContext.Current.ResetItem();
I am not sure if this will help in your case but it fixed my problem.

Resources