Skip to content

Instantly share code, notes, and snippets.

alert( "hello world" );
@linusthe3rd
linusthe3rd / gist:673665
Created November 12, 2010 02:58
YourViewController.m
#import "YourViewController.h"
#import <QuartzCore/QuartzCore.h> //required to achieve corner radius
//.....Setup your controller...
- (void)viewDidLoad {
[super viewDidLoad];
//add a corner radius to the UILabel
self.label.layer.cornerRadius = 8;
}
//....the rest of your controller code goes here...
var query_string = '';
$("someElement").each( function() {
if (this.checked) {
query_string += "&test[]=" + this.value;
}
});
$.ajax({
type: 'POST',
var inputArray = [];
$('#listOfData').each( function(){
inputArray.push( this.value );
});
$.post( 'yourServerPage.php', {
'data[]': inputArray
}, function( outputData ){
$('#outputDiv').empty().append( outputData );
});
$.get( "yourServerPage.php", {
'data[]': inputArray
}, function( outputData ){
$("#outputDiv")
.empty()
.append( outputData );
});
$("#outputDiv").load( "yourServerPage.php", {
'data[]': inputArray
(function() {
//set up your widget
dojo.declare("MyTable", dijit._Widget, {
//other widget method declarations
buildRows: function(){
dojo.forEach(users, dojo.hitch(this, function(user){
(function() {
//set up your widget
dojo.declare("MyTable", dijit._Widget, {
constructor: function(args){
//other stuff to instantiate
this._childWidgets = [];
//==================
// Track a widget
//==================
var actionButtons = new ActionButtons(); //ActionButtons now needs to be destroyed!!
this._childWidgets.push(actionButtons);
//==================
// Track an event handler
//==================
var handle = dojo.connect( /*your params*/ );
(function() {
//set up your widget
dojo.declare("MyTable", dijit._Widget, {
//initiation methods for your widget
destroy: function(){
//destroy your child widgets
@linusthe3rd
linusthe3rd / gist:705083
Created November 18, 2010 15:00
Updating a dojo widget's date
function updateTheWidget(){
var newData = getData() // handles the xhr request to retrieve the new set of data
theWidget.attr("data", newData); //update the widget with the new set of data
theWidget.refresh(); //refresh the widget UI
}