You modify the length menu by the aLengthMenu setting
$('#example').dataTable({
aLengthMenu : [5, 10, 25, 50]
});
To dynamically change the menu, you must access the generated <select> box in code. It has a name, which always is table id + _length, so a table with the id example will have a length menu with the name example_length
Here an example, dynamically changing the length menu to hold 5 and 10 only
var dataTable = $('#example').dataTable();
var newLength = [5, 10];
var aLengthMenu = $('select[name=example_length]');
$(aLengthMenu).find('option').remove();
for (var i=0;i<newLength.length;i++) {
$(aLengthMenu).append('<option value="'+newLength[i]+'">'+newLength[i]+'</option>');
}
To disable the menu, simply add the disabled attribute
$(aLengthMenu).prop('disabled', 'disabled');
working demo with the code above http://jsfiddle.net/Mz5WZ/