Smart Grid v1.3

Dynamic loading

Often tables have a lot of rows, so it takes a lot of time to load all them even if you need to modify a couple of them. Sometimes it is almost impossible to upload all the data because of the their huge size.

Dynamic loading mode allows you to work with big data sets and load data when you need them only. You just scroll the grid and it loads the rows that should appear in visible area of the Smart Grid control.

This way you could manage tables with thousands rows as easy as if they have only a dozen of rows. The Smart Grid control placed below works with table that has 1000 rows. Imagine you'd have to load all the rows every time you open the page in browser - you'd spend a lot of time and traffic.

The Dynamic loading is compatible with paging and Frozen columns mode.






Code of the example


<script language="JavaScript">

SmartCells.set_handlers();

var smart_grid3 = new SmartGrid('smart_grid3');
	smart_grid3.on_save_cell = sg_cancel_edit;
	smart_grid3.image_path = 'img/';

	smart_grid3.dynamic_loading = true;

	smart_grid3.data_url = 'xml_big_data.php';


var sc31 = new SmartCell_text();
	sc31.params = {
db_field: 'name'
	};
var sc31_params = {
	'name': 'Id',
	'width': '140'
};
	sc31.readonly = true;
	smart_grid3.add_column(sc31_params, sc31);


var sc32 = new SmartCell_text();
	sc32.params = {
db_field: 'surname'
	};
var sc32_params = {
	'name': 'Number',
	'width': '100'
};
	smart_grid3.add_column(sc32_params, sc32);


	smart_grid3.show();

// dummy function (cancels changes)
function sg_cancel_edit() {

	this.cancel_edit();

}

</script>