function coreSettings(){this.prefix = "http://dreakmore.info/tgrid/server/server.php";}var core = new coreSettings();

function model1(id,custom,crud)
{
	this.id = id;
	this.__defined_cols = ["first_name","last_name","team"];
	if (custom != null) {
		this.__defined_cols = ["last_name","custom-column","first_name","team"];
		this.renderers = {
			"first_name": function(x, r){ return "My first name is <b>"+x+"</b> and my ID is: "+r["ID"]; },
			"custom-column": function(x, r){ return "I'm the custom column. ID is: "+r["ID"]; }
		}
	}
	if (crud != null) {
		this.colName = "ID";
		this.editHref = function(r){ return "javascript:m4.edytuj("+r["ID"]+");"; };
		this.checkBoxName = "record";
		this.CRUD_COMPLETE = function(out) {
			alert("I'm the custom function for confirmation of record save");
			this.setActiveCRUD("list");
			this.rf();
		}		
	}
}

model1.prototype = new jsModel();
var m1 = new model1("m1");
var m2 = new model1("m2");
var m3 = new model1("m3",1);
var m4 = new model1("m4",null, 1);

$(document).ready(function(){
	$("#m1_table").tgrid({object: m1});
	$("#m2_table").tgrid({object: m2});
	$("#m3_table").tgrid({object: m3});
	$("#m4_table").tgrid({object: m4});
	$("#form_m4 form").submit(m4.CRUD);
	m1.rf(m2.rf(m3.rf(m4.rf())));
	enableFiltering();
});
