Show Posts
|
Pages: [1] 2 3
|
3
|
General Category / EasyUI for jQuery / data dont appear in a datagrid
|
on: July 09, 2016, 09:30:53 AM
|
I try to add value in a datagrid. The following code doesn't show anything in the data grid HTML <table id="listeRegates" class="easyui-datagrid" style="height:450px" title="Regates/Courses chargees" iconCls="icon-save" sortName="date" sortOrder="asc" rownumbers="true" pagination="true" toolbar="#tb"> <thead> <tr> <th field="regate" width="120" sortable="true">Regate/Course</th> <th field="date" width="60" sortable="true">Date debut</th> <th field="description" width="120" sortable="true">Description</th> <th field="organisateur" width="80" sortable="true">Organisateur</th> <th field="demo" checkbox="true" width="80" align="right" sortable="true">Demo</th> <th field="affichage" checkbox="true" width="120" align="right" sortable="true">Affichage autorise</th> <th field="supprimer" checkbox="true" align="center" width="60">A supprimer</th> </tr> </thead> </table> <div id="tb" style="padding:2px 5px;"> Date From: <input class="easyui-datebox" style="width:110px"> To: <input class="easyui-datebox" style="width:110px"> <a id="btn_remove" href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Remove record</a> </div>
the javascript code $(document).ready(function(){
$('#listeRegates').datagrid({ data:[{ "regate": "Régate démo 1", "date": "2014-01-01", "description": "Régate d'hiver dans la baie d'Hyères", "organisateur": "Hyères Plaisance Organisation", "demo": "1", "affichage": "1", "supprimer": "0" }, { "regate": "Régate démo 2", "date": "2014-05-01", "description": "Régate de printemps entre La Londe et Cavalaire", "organisateur": "La Londe Plaisance Organisation", "demo": "1", "affichage": "1", "supprimer": "0"}] }); });
I get the following on the screen (see enclosed file datagrid.gif) Is a problem with my format of data ?
|
|
|
4
|
General Category / EasyUI for jQuery / Re: How to upload a file with an easyui-filebox
|
on: July 09, 2016, 04:05:39 AM
|
Thank stworthy. I implemented this code to transmit my file via a form HTML firstly <table> <tr> <td style="width:70%;"> <form id="uploadFile" enctype="multipart/form-data" method="post"> <input id="chooseFile" class="easyui-filebox" name="file1" data-options="prompt:'Choose a file...'" style="width:25%"> <a id="btn_add" href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true">Add File</a> </form></td> <td style="width:30%;"><div id="progressFile" class="easyui-progressbar" style="width:100%;"></div></td> </tr> </table> javascript code secondly $(document).ready(function(){
$('#uploadFile').form({ url:'{PATH_TO_ROOT}/regate/?url=/ajax/tree', ajax:'true', iframe:'false', // pour activer le onProgress onProgress: function(percent){ // pendant l'envoi du fichier $('#progressFile').progressbar('setValue', percent); }, success: function(data){ // apres l'envoi du fichier en cas de succes alert('succes'); }, onLoadError: function(){ // apres l'envoi du fichier en cas d'erreur } });
$('#btn_add').bind('click', function(){ // vérification si le champ du nom de fichier est vide ou non if($('#chooseFile').filebox('getValue')!="") { // transfer le fichier en assynchrone $('#uploadFile').submit(); // on envoie le fichier } }); });
The code is OK, the php file is called, but during the transmit of a file ( even a big file), the onProgress Method is NEVER called. I've put iframe to false, but it's the same. Where is my error ?
|
|
|
7
|
General Category / EasyUI for jQuery / Enable or disable individual checkbox of a tree
|
on: September 21, 2014, 11:43:58 AM
|
Hello
I have a tree with many nodes with checkbox. When I select a checkbox, I call an asynchrone task which puts data in a array and when I deselect the same checkbox, I execute synchrone task which modify (delete) data from the same array.
I have a problem when I check/uncheck quickly the checkbox. The sync task is executed before the end of the async task and the behaviour is inccorect.
I can prevent this problem if I disable temporarily the checkbox (it becomes Grey tint as on microsoft Windows) and I enable the checkbox when the assync task is finished to prevent the user to modify the checkbox.
Unfortunately, I haven't seen in the documentation a means to achieve this.
Could you help me ?
|
|
|
9
|
General Category / EasyUI for jQuery / Re: How to use loadfilter in a tree
|
on: September 10, 2014, 09:07:42 AM
|
Th aim is to modifi the return of the data from the server before displaying thes data in the tree. Are you sure that "Loader" function is the good one for that ?
I have understood that this fonction is call for loading data instead the url method ?
|
|
|
11
|
General Category / EasyUI for jQuery / Re: Expand event doesn't fire every time
|
on: September 08, 2014, 10:12:34 AM
|
I have not the control on the return method of my php code, because I use API framework function. For example, it returns to me this data {{"id":101,"text":"Groupe voiliers classe C","attributes":{"info":"Voiliers de classe C\n Sponsors: Sponsor classe C, , ","table":"phpboost_regate_groupe","idDb":"2"},"state":"closed"},{"id":102,"text":"Groupe voiliers classe D","attributes":{"info":"Voiliers de classe D\n Sponsors: Sponsor classe D, , ","table":"phpboost_regate_groupe","idDb":"2"},"state":"closed"}};
And I must transform in the javascript code in [{"id":101,"text":"Groupe voiliers classe C","attributes":{"info":"Voiliers de classe C\n Sponsors: Sponsor classe C, , ","table":"phpboost_regate_groupe","idDb":"2"},"state":"closed"},{"id":102,"text":"Groupe voiliers classe D","attributes":{"info":"Voiliers de classe D\n Sponsors: Sponsor classe D, , ","table":"phpboost_regate_groupe","idDb":"2"},"state":"closed"}];
I have test it with my first method and The data appears in the tree after 3 selections of the expand icon. The problem isn't in this json code but in 'loadFilter' which is never called. Maybe a supplementary parameters to put ?
|
|
|
12
|
General Category / EasyUI for jQuery / Re: Expand event doesn't fire every time
|
on: September 07, 2014, 11:27:29 AM
|
Following your last remarks, I decided du test URL Method, but as my PHP code generates not directly Jsoncode, I decide to add the loadFilter Method to convert data return by PHP code to modify it as a correct json format. But my loadFilter is never called (beakpoint inside with firebug) Here is the javascript code. I call the 'creeArbre()' method to create the tree function convert(nodes) { var long=nodes.length; var nodes1='['+nodes.substring(1,long-1)+']'; // on fabrique une chaine au format json var nodesJson= J.parseJSON(nodes1);// on convertit en objet json (tableau de valeurs) return nodesJson; }
function creeArbre(mode) { J('#treev').tree({ url: '{PATH_TO_ROOT}/regate/?url=/ajax/tree', // L'url vers laquelle la requete sera envoyee method:'get', queryParams: {mode: mode}, // Les donnees que l'on souhaite envoyer au serveur au format JSON loadFilter:function(nodes){ return convert(nodes); } }); }
What is wrong ? Thank you
|
|
|
13
|
General Category / EasyUI for jQuery / Re: Expand event doesn't fire every time
|
on: September 07, 2014, 08:33:20 AM
|
Do I understand that I can use level1-1, level1-2 for example for the two first nodes of the first level, then level2-1, level2-2,... for the nodes of the secondlevel, exctera,.... ? I thought that id can only be a number.
If yes, it would be easyer for me to retreive the good table where are stored the data of the tree.
|
|
|
14
|
General Category / EasyUI for jQuery / Re: Expand event doesn't fire every time
|
on: September 07, 2014, 05:23:38 AM
|
I tried the 'onBeforeExpand' event , but there is an other problem about the assyncrhonous answer between when I click to expand and when the answer arrive with data. So nothing appears in the tree due to the delay ! I decided to explore the way of the URL included in the create tree instead of methods based on intercepting the behaviour of the tree. The URL method sends "id' of the node that you want to expand. When I saw this example http://www.jeasyui.com/tutorial/tree/tree2_demo.htmlthe data are embedded in a database with all id and parentid defined. It's a plate structure. I have an relational database storing my value that I want to retreive for the treeview. So a 'regata' contains 'groups' wich contains themselves 'contacts' with contains themselves 'pointGPS'. It's a hierarchical data that I want to put in the tree with the URL mecanism. The structure is not planned as the example and when I retreive an 'id' from the userclick, I have no way to find with my database if I 'm at the first level (regata), second level (groups), third level (contact) or fourth level (pointGPS) ! Have you an idea to deal with this situation ? Maybe must I use the scheme described here http://www.jeasyui.com/tutorial/tree/treegrid5.php. It was just à little the first method I have to implement by without success. Thanks for your help, because I've passed many hours on this problem , and I'm sceptical to arrive to find a solution.
|
|
|
15
|
General Category / EasyUI for jQuery / Re: Expand event doesn't fire every time
|
on: September 06, 2014, 11:23:08 AM
|
OK, I well understood the mecanism with your explanation. Thanks very much.
Effectively, the children is created with a personnal ajax call, and not the url , because I don't arrive to generate a good json code in PHP, so I must transmit a string, modifiy in javascript start and finish character ( [] instead {} ) and then convert into json object before to append to the tree as a children of the node expand previously.
|
|
|
|