params = {isEncoded: false};
buffer=new Rico.Buffer.AjaxSQL(url, params);
| [ 0 trackbacks ] | permalink | related link |




( 3.1 / 50 )If your LiveGrids stopped working when you upgraded to Prototype 1.6, this is probably the cause:
change 2 lines in
ricoLiveGridAjax.js:
from:
return $H(queryHash);
to:
return queryHash;
from:
Rico.writeDebugMsg('req '+this.requestCount+':'+
this.ajaxOptions.parameters.inspect());
to:
Rico.writeDebugMsg('sending ajax req #'+this.requestCount);
This change is also compatible with older versions of Prototype.
| [ 0 trackbacks ] | permalink | related link |




( 2.9 / 44 )| [ 0 trackbacks ] | permalink | related link |




( 3 / 50 )Occasionally, IE will fail to run Rico.Corner.round() and other commands issued after the DOM has loaded - even when using:
Event.observe(window, 'load', my_function);
The answer, it seems, is to delay the Rico calls until the Rico.OnLoad event is triggered...
Rico.onLoad( function(){
//my Rioc.Round.corner calls etc
});Just in case you, like me, were wondering why....
| [ 0 trackbacks ] | permalink | related link |




( 3 / 59 )
This is a great freeware app I stumbled upon today that lets you manage your Windows system environment variables via a GUI. In particular, it's handy for updating your PATH variable - especially if you're a framework developer ;-)
| [ 0 trackbacks ] | permalink | related link |




( 3.2 / 56 )I know everyone's supposed to fall in love with sudo, but me well I like being a root user - call me old fashioned...
Anyway, here's an easy way to do it:
sudo passwd
Nice :)
| [ 0 trackbacks ] | permalink | related link |




( 3 / 66 )If you write PHP and haven't heard of qcodo then this is must see TV:
http://qcodo.com/demos/beta_2/demo_b_qf ... forms.html
Basically, qcodo defines an event-driven model for HTML forms, much like ASP.NET does. So you can run server commands on button clicks, for example. Then you can convert an entire form to AJAX by changing the server event to an AJAX event. If this doesn't make sense then the video should clarify it.
Very tasty stuff...
| [ 0 trackbacks ] | permalink | related link |




( 3 / 64 )Ever had the need to add a drop menu to existing navigation? It's a dilemma, I can tell you. There are a lot of applications, scripts and tools for building DHTML menus from scratch, but they usually won't integrate into your existing site very easily. So you have the option to reverse engineer your existing navigation, but then you have to integrate the end result back into the site. Either way you're in for some serious time wastage. Or you can roll your own like this....
1. Make a Div for each menu and a Div for each item in the menu like this:
<div id="menu_1" class="menu" style="display:none;"
onmouseover="menu_on(1);" onmouseout="menu_off(1);">
<div class="submenu">
<a href="link1.php">Menu Item 1</a>
</div>
<div class="submenu">
<a href="link2.php">Menu Item 2</a>
</div>
</div>
Note the class names: "menu" for the container Div and "submenu" for the items. Also note the onmouseover and onmouseout events - these are used to show and hide the menus.
2. Add the mouse events to your existing navigationitem like this:
<span onmouseover="show_menu(1,this);"
onmouseout="hide_menu(1);"
>Existing Navigation Link
</span>
3. Add the JavaScript functions:
<script>
var active_menu = 0;
function show_menu(id,element){
active_menu = id;
menu = document.getElementById("menu_" + id);
menu.style.left = findLeft(element) - 3 + 'px';
menu.style.display="block";
}
function time_out(id){
if (active_menu != id){
document.getElementById("menu_" + id).style.display="none";
}
}
function hide_menu(id){
active_menu = 0;
setTimeout("time_out(" + id + ")",40);
}
function findLeft(obj) {
var curleft = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft;
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft;
}
}
return curleft;
}
function menu_on(id){
active_menu = id;
}
function menu_off(id){
active_menu = 0;
setTimeout("time_out(" + id + ")",40);
}
</script>
4. Add the CSS:
.menu{
top: 100px;
position: absolute;
width: 130px;
background: #b3a755;
line-height: 20px;
padding: 2px 0;
}
.submenu{
background: #b3a755;
padding: 2px;
display: block;
clear: both;
}
.submenu a{
width: 120px;
background: none;
}
.submenu a:hover{
background: #d0c897;
text-decoration: none;
}
.menu{top: expression('110px');}There is a limitation here - the menu is located at a fixed position from the window top (120px in Firefox, 110px in IE). You could get around this by detecting the offsetTop of the navigation element (just as we detected the offsetLeft in the script above). I didn't need it, so I didn't do it - but it can easily be done!). Note that the CSS here is purely cosmetic so you can modify it without messing up the functionality of the rollovers.
| [ 0 trackbacks ] | permalink | related link |




( 2.9 / 47 )
I have spent a couple of days playing with CakePHP and, I dare confess, I think I am hooked. Some of the things that leap out at me are:
* Scaffolding - great for quick admin systems which can be rendered-out to PHP code when your database schema is finished.
* Remote controllers - I have often used page classes so that I can call controller methods from another page, but CakePHP simplifies this process. You can retrieve data from another controller inside a view template.
* Multiple views per controller - this is a killer feature built into the framework. Change the URL to include "xml" or "rest" or "soap", for example, and have the controller automatically execute the relevant function to produce your Web service.
* Built in Unit testing with simpletest.
* Template helpers - AJAX, JavasScript and HTML helpers to render well formed tags that can be controlled via a centrlised INI file. Nice.
* External framework - you can store your cake files in a non-web viewable folder and, come update time, just overwrite the whole lot. Easy.
I just wish I had the time to reverse engineer all my current projects to Cake!
| [ 0 trackbacks ] | permalink | related link |




( 3.1 / 47 )The last thing you want to do when building an Ajax application is to bring your server to it's knees with too many simultaneous requests.
So, I have built a little queue into some of my ajax calls to ensure that no client makes more than a certain number of simultaneous Ajax connections. It's procedural and simple so anyone can use it.
Basically, there's a global variable that tracks the number of ajax calls in progress. When the function that makes the ajax connection is called and the number of connections is too high, a setTimeout is used to call the same function again in specified number of milliseconds.
I know it's easy, but that's why I did it that way. No subclasses, no version issues...
var ajax_conn = 0;
function load(x,y,z){
if (ajax_conn > 4 ){
setTimeout("load('" + x + "','" + y + "','" + z + "')",3000);
}else{
ajax_conn++;
var myAjax = new Ajax.Updater(
element_id,
the_ajax_url,
{
method: 'get',
parameters: 'x=' + x + "&y=" + "&z=" + z,
evalScripts: true,
onComplete: function(){load_done(x,y,z));}
}
);
}
}
function load_done(x,y,z){
ajax_conn--;
return function(originalRequest) {
return true;
}
}
Note that you have to use function() in the onComplete event or else the code will be executed immediately and you'll never get your limit reached. Likewise, the timeout is an evaluated function call.
If you're wondering why I'm passing the original parameters to the load_done function, its so I can use them to check that the update actually occurred. Plus, sometimes browsers won't re-render the object even though it is updated, but that is another story...
| [ 0 trackbacks ] | permalink | related link |




( 3 / 55 )Back Next



Avatar



