Can anyone help me with the code for keep some columns always visible, independent of horisontal scrolling position.

Such functionality available only in pro edition, you need to include dhtmlxgrid_split.js in your project and  has next code

grid = new…

grid.splitAt(2); //2 - cout of always visible columns

Pro package contains some split related samples