EasyUI Forum
April 27, 2024, 02:16:01 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: 1 2 [3] 4
31  General Category / EasyUI for jQuery / Re: validate a textfield just a text!!! on: September 02, 2012, 10:31:48 PM
Hi Varonica, sorry you right, I did not understand what you meant. I guess what you did want to say was "...but cant find how to extend validtype just for text only!!!!". mzeddd solution only tests the first character, so if the user enters "W8", the function passes. I guess not what you want. You can use RegExp to solve this. You can try the following;
Code:
justText: {  
   validator: function(value, param){ 
         return !value.match(/[0-9]/);
   }, 
   message: 'Please enter only text.' 

32  General Category / EasyUI for jQuery / Re: datagrid in layout won't trigger scroll bar? on: September 02, 2012, 02:18:09 AM
Ok, I've checked your code. A few pointers to start with; jQuery does not like tags that are closed within the start tag, ie <div region="east" style="width:0px" />. These need proper closing tags - </div>. I also noticed that most of your table tags where missing closing tags.

As for the scrolling action, this you will only see when there is data in your table. The following code should display your layout correctly. I've added width property to each column (I was testing with 1.2.6) and removed the format functions.

Code:
<body class="easyui-layout">

<div region="north" style="height:100px;background:#7f7f7f"></div>
<div region="south" style="text-align:right"></div>
<div region="east" style="width:0px"></div>
<div region="west" style="width:0px"></div>

<div region="center">
  <div class="easyui-panel">Control Area</div>
  <hr>
<table id="tt" class="easyui-datagrid" singleSelect="true" iconCls="icon-save">
      <thead>
        <tr>
          <th field="recordPushAt" rowspan="2" width="80" >Push At
          <th field="recordPackets" rowspan="2" width="80" >Packets
          <th field="recordOctets" rowspan="2" width="80" >Octets
          <th field="recordStartAt" rowspan="2" width="80" >Start At
          <th field="recordEndAt" rowspan="2" width="80" >End At
          <th colspan="4" width="80" >Source
          <th colspan="4" width="80" >Destination
          <th field="recordNextHop" rowspan="2" width="80" >Next Hop
          <th field="recordInput" rowspan="2" width="80" >Input
          <th field="recordOutput" rowspan="2" width="80" >Output
          <th field="recordProtocol" rowspan="2" width="80" >Protocol
          <th field="recordTos" rowspan="2" width="80" >Tos
          <th field="recordTcpFlags" rowspan="2" width="80" >Tcp Flags
          <th colspan="2" width="80" >Engine
        </tr>
        <tr>
          <th field="recordSrcAddr" width="80" >Ip Address
          <th field="recordSrcMask" width="80" >Mask
          <th field="recordSrcPort" width="80" >Port
          <th field="recordSrcAS" width="80" >AS
          <th field="recordDstAddr" width="80" >Ip Address
          <th field="recordDstMask" width="80" >Mask
          <th field="recordDstPort" width="80" >Port
          <th field="recordDstAS" width="80" >AS
          <th field="recordEngineType" width="80" >Engine Type
          <th field="recordEngineId" width="80" >Engine Id
        </tr>
      </thead>
      <tr>
        <td>1</td>
      </tr>
      <tr>
        <td>2</td>
      </tr>
    </table>
   </div>
  </body>
33  General Category / EasyUI for jQuery / Re: datagrid in layout won't trigger scroll bar? on: August 30, 2012, 11:23:21 AM
Hi magicloud, it's difficult to make any comment without seeing any code. Could you attach so code as I suspect you have some coding error. But in the meantime, have you set the fit property to true?
34  General Category / EasyUI for jQuery / Re: validate a textfield just a text!!! on: August 30, 2012, 11:10:20 AM
Hi Varonica

Not sure what you would like to validate, but there are a number of examples in the forums. But here are 3 examples (the temperature validation is similar to number range).

$.extend($.fn.validatebox.defaults.rules, {
   tempRange: {
      validator: function(value, param){
         return (value >= param[0] && value <= param[1]);
      },
      message: 'Temperature must be in the range of {0}°C and {1}°C.'
   },
   numRange: {
      validator: function(value, param){
         return (value >= param[1] && value <= param[2]);
      },
      message: '{0} must be between {1} and {2}.'
   },
   maxLength: {
      validator: function(value, param){
         return value.length <= param[0];
      },
      message: 'Maximum characters allowed is {0}.'
   }
});


This is the html part;
  <input id="minTemp" name="minTemp" class="easyui-validatebox tempVal" required="true" validType="tempRange[-50,70]">
  <input name="tolerance" size="10" class="easyui-validatebox" validType="numRange['Range',0,5000]">
  <textarea name="notes" style="height:80px;width:473px;" class="easyui-validatebox" validType="maxLength[300]"> ></textarea>
35  General Category / General Discussion / Re: License and further information bout your company on: August 30, 2012, 09:08:40 AM
Hi spieler, we have purchased a licence for jeasyui and can assure you we have only had the best and professional service from stworthy. Just have a look at the downloads section to see how many updates have come out. stworthy is also very active on the forums and as a paid member, he has answered all of my questions/requests to date.
36  General Category / EasyUI for jQuery / Re: js functions dynamic tabs on: May 17, 2012, 03:53:26 PM
Sorry about that. I should read a little slower. Ok, try this and then modify it for your code.
Create a file and call it test.php. Add this code to it;
Code:
<!DOCTYPE html>
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Demo</title>
      <link class="jeasycss" rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css" />

      <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
      <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
      <script type="text/javascript">
         function openTab() {
            $('#tt').tabs('add', {
               title: 'New Tab',
               href: 'tab.php',
               closable: true
            });
         }
      </script>
   </head>
   <body class="easyui-layout" style="text-align:left">
      <div region="west" border="false" split="true" title="Topics" style="width:250px;padding:5px;">
         <ul class="easyui-tree">
            <li><span>Login</span>
               <ul>
                  <li><a href="#" onclick="openTab()">Topic 1</a></li>
                  <li><a href="#" onclick="openTab()">Topic 2</a></li>
               </ul>
            </li>
         </ul>
      </div>
      <div region="center" border="false">
         <div id="tt" class="easyui-tabs" fit="true" border="false" plain="true">
         </div>
      </div>
   </body>
</html>

Then create another file and call that tab.php. Add this code to it;
Code:
<table id="tt"></table>
<script type="text/javascript">
   function sayHello() {
      $.messager.alert('Message', 'Hello');
   }
</script>
<table id="tt" class="easyui-datagrid" style="width:700px;height:250px"
   title="Load Data" iconCls="icon-save"
   rownumbers="true" pagination="true">
   <thead>
      <tr>
         <th field="itemid" width="80">Item ID</th>
         <th field="productid" width="120">Product ID</th>
         <th field="listprice" width="80" align="right">List Price</th>
         <th field="unitcost" width="80" align="right">Unit Cost</th>
         <th field="attr1" width="200">Attribute</th>
         <th field="status" width="60" align="center">Stauts</th>
      </tr>
   </thead>
</table>
<button onclick="sayHello()">Say Hello</button>

Whenever you click on an item in the tree, it will open a tab and display a working jeasyui datagrid in the tab. There is also a button to run some simple JavaScript which calls a jeasyui function. I'm not sure what you are doing in your php code, but I hope this helps.
37  General Category / EasyUI for jQuery / Re: js functions dynamic tabs on: May 17, 2012, 07:01:02 AM
Hi Baxter, welcome to the community. I'm doing pretty must the same as what your code does without any issues. Make sure title and url have valid data. Also, check the way you are referencing your call to the PHP file. Try removing the / from you href. ie href: "window.php"+url,

I would also try this to make sure your basic logic is working. Just create a file with the following line;
Hello World!

Save it as 'hello.php' in the root folder of you web site.

Change your call to create the tab to;
               $('#tt').tabs('add', {
                  title: 'My Title',
                  href: 'hello.php',
                  closable: true
               });
Test it to make sure it is working and then add the features you required before. When it breaks, you will know what is causing this.
38  General Category / EasyUI for jQuery / Tip - Selected records from a datagrid not removed from memory after delete on: May 17, 2012, 06:24:29 AM
If you enable the idField in a datagrid and set singleSelect to false, and then select some records to be deleted. You send this list to the server and the server removes these records. You then call the reload method to reload the data, the datagrid will reload the data correctly (ie no previously selected records that were deleted are displayed). Lets say you select a new record and call the getSelections method, you will get a list containing this selected record and the previously deleted records! Note: if idField is not set, then the previously selected records are cleared with the reload. ie You don't see them in the getSelections.

So an easy way to solve this is to just call the clearSelections method before (or directly after) calling the reload method.

This was driving me crazy as I thought the reload method would only have the reloaded records. Of course the reload method will not know if a record has been deleted or not if you are using paging in the datagrid.
39  General Category / EasyUI for jQuery / Re: no (jQuery)Tooltip within datagrid? on: May 09, 2012, 08:26:22 AM
Hi Digo

I think the problem is that the table is being created after the call to setup the tooltips. Thus not HTML exists for the table. The way I could see this was in Firebug. I put a break point at '$('.demo-async-timeout').poshytip({' and noticed that only the header of the table was drawn. You could call the code '$('.demo-basic').poshytip();'  after the table has been rendered. ie add onLoadSuccess: method.

I did implement my own tooltip and noticed that I had to increase the z-index value for the tooltip div. So if you no longer see the tooltip, but can see the code in Firebug, try increasing the z-index.
40  General Category / EasyUI for jQuery / Re: How to add combobox to toolbar of datagrid with programming instead of html tag on: May 07, 2012, 04:07:07 AM
I was also wondering how to do this but the answer is quite easy (of course there could be other ways to do this). I just mixed the 2 methods. I added the Toolbar part via HTML and the rest via JavaScript. For example;

Javascript Part
$('#dg').datagrid({
   fit: true,
   idField: 'date',
   columns: [[
      { field: 'date', title: 'Date', width: 80 },
      { field: 'desc', title: 'Description', width: 300 },
      { field: 'amount', title: 'Amount', width: 800, align: 'right'}
   ]]
});

HTML Part
<table id="dg" toolbar="#toolbar" ></table>
<div id="toolbar">
   <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="edit()">Edit</a>
   <a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="save()">Save</a>
   <label>Select Option:</label>
   <select id="selection">
      <option value="1">Option1</option>
      <option value="2">Option2</option>
      <option value="3">Option3</option>
   </select>
</div>

Adding a seperator is also pretty easy via HTML but you need to add the following style to the anchor tags (as per the example above);  style="float: left;"
Thus the a tags would read;
<a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="edit()" style="float: left;">Edit</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="save()" style="float: left;">Save</a>

Now just insert the following code where you want the seperator to appear;
<div class="datagrid-btn-separator"></div>
41  General Category / Bug Report / Re: Problem with DateTimeBox on: May 07, 2012, 01:44:59 AM
Thanks stworthy for your quick update to fix this. Works great.
42  General Category / EasyUI for jQuery / Re: Calendar control presents problems in October on: May 03, 2012, 05:53:11 AM
Could you maybe include some code to your problem, what browser and version did you see this in. A screen shot will also be helpful to see what you are seeing. I've tested this on FF12 and IE9 and could not see any issues for October. The code is included below;

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
   <head>
      <title>jQuery Date Time Inout</title>
      <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
      <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
      <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
      <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
      <script type="text/javascript">
          $(function () {
             $('#dd').datebox({
                required: true
             });
          });
      </script>
   </head>
   <body>
      <form id="ff" method="post">
         <div>
            <label for="name">Date:</label>
            <input id="dd" type="text"></input>
         </div>
      </form>
   </body>
</html>
43  General Category / Bug Report / Problem with DateTimeBox on: May 03, 2012, 05:37:00 AM
I've been trying to disable the showing of seconds in the DateTimeBox but this does not seem to work. It does work for the TimeSpinner. I also noticed that if you don't set the seconds part when setting the date time value, you get a NaN error in the date time string. The code I used to test with was;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
   <head>
      <title>jQuery Date Time Inout</title>
      <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
      <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
      <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
      <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
      <script type="text/javascript">
          $(function () {
             $('#dt').datetimebox({
                showSeconds: false
             });
          });
      </script>
   </head>
   <body>
      <form id="ff" method="post">
         <div>
            <label for="name">Date:</label>
            <input id="dt" type="text"></input>
         </div>
      </form>
   </body>
</html>
44  General Category / Bug Report / Re: Dialog buttons on: April 19, 2012, 08:47:11 AM
You are welcome Xiaolin. It happens to the best of us Wink I also noticed when testing on Firefox, maximise opens to the full width of the page, but the height is fixed to 200px. It did not matter what the size of my browser window was.

Another point, I guess it might be through design, but minimize seems to do the same as the close button, ie sets the style 'display:none'.
45  General Category / News / Re: jQuery EasyUI 1.2.6 Release on: April 18, 2012, 05:59:24 AM
Flipping great news stworthy. Thanks for all your hard work in making this the best framework around. Looking forward to test with it. As a purchaser of the commercial license, do we get the source code of the latest version?
Pages: 1 2 [3] 4
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!