Demonstration of a selection indicator for a dojox grid.
- Grey checkmark serves as select all/deselect all, if no rows are selected, clicking on the checkmark will select them all, if any rows are selected, all will be deselected.
- Row selector uses a green checkmark to indicate selection. Additional styling can be applied.
- Add and remove rows work, but no save is performed.
- Icons from Crystal Project (http://everaldo.com/crystal)
* Demonstration is for the design, not operation of grid.
This example shows the HTML and PHP to upload a file.
Browsers handle the MAX_FILE_SIZE input and accept attribute differently. Some will filter the files offered through the dialog box to only list those identified by the accept attribute. Some will allow you to select a file that is too large, and submit it to the server, without any content. In this case, the tmp_name is empty, error is 2, and size is 0.
In all cases you must validate the file on the server side.
HTML to upload a file:
PHP to accept it:
Open Source software is often maturing.
Cycling back to the distribution site has many advantages:
- Upgrading open source components usually delivers many bug fixes and new features. Although upgrading after ever update is probably unnecessary, it is worth considering an upgrade if something isn’t working exactly as expected.
- Upgrading increases the lifespan of your code, as well as often improving the quality.
- Documentation often improves, both directly from the author and with contributions from other users. Repeat visits usually increases understanding.
- As new features are added, they can be integrated into your code.
- As you learn more, you can contribute to the site.
Cycling back through your application also has many advantages:
- As your skills improve, your code will, too. Revisiting code allows you to improve it.
- Look for ways to consolidate and reuse code. The less code you have to maintain, the better. Overly complex or large applications are often more difficult to work with than sleek, elegant systems.
- Validate XHTML and CSS periodically.
- Use jsLint, and other tools.
- Run the pages through different browsers after major changes.
- Keep an eye on the architecture, understand what goes where and why.
- Add comments for things that are difficult to understand.
- Look for opportunities to improve performance.
- Use Firebug to get the session id off the page requests.
- Find the directory session files are stored in. On busy, shared servers, this is often /tmp. Check /etc/php.ini or possibly /etc/httpd/conf.d/php.conf.
- To simulate a session timeout on the server side, delete the session file.
- To simulate a cookie timeout on the client side, delete all private data (FF) or cookies (IE).
- To simulate a lost connection - disconnect or disable the network connection.
- Use more to view the contents of a session file.
- Use session files to reduce the amount of logic required for execution. You can assume the session file must be read for authentication, therefore, adding a few more bytes in to reduce execution time should yield a performance gain. Be careful to only store data which is valuable for enough operations that the storage increase is warranted.
- ACL can be stored in session files. It may be faster than using a database.
- Never store passwords in session data.
- Language in use is good for storage in session files.
- Session files must not be accessible through the web. Should only be accessible for appropriate users.