jQWidgets Forums

jQuery UI Widgets Forums Grid jqxgrid localization can be changed only once and not anymore times?!

This topic contains 2 replies, has 2 voices, and was last updated by  homam 12 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • homam
    Member

    Hi i have a jqxgrid and i want to change its localization with a click on a div here is my code:

    $(function(){
    	$('body').on('click', '.lang-select', function(){
    		if($(this).data('lang') == 'pe'){
    			$(this).parent('div').append('<div class="lang-select" data-lang="en">English</div>');
    			$(this).remove();
    			$('body').find(".file-confirmation-content").jqxGrid({
    				columns: [
    					{ text: 'شناسه فایل', datafield: 'fileid', width: 40, cellsalign: 'center', align: 'center', cellsrenderer: rowfileid },
    					{ text: 'نام فایل', datafield: 'filename', cellsalign: 'center', align: 'center', width: 100, cellsrenderer: rowfilename  },
    					{ text: 'عنوان فایل', datafield: 'title', cellsalign: 'center', align: 'center', width: 100 },
    					{ text: 'کاربران', width: 'auto', cellsalign: 'left', align: 'center', cellsrenderer: users }
    				],
    			});
    		}
    		if($(this).data('lang') == 'en'){
    			$(this).parent('div').append('<div class="lang-select" data-lang="pe">فارسی</div>');
    			$(this).remove();
    			$('body').find(".file-confirmation-content").jqxGrid({
    				columns: [
    					{ text: 'File id', datafield: 'fileid', width: 40, cellsalign: 'center', align: 'center', cellsrenderer: rowfileid },
    					{ text: 'File Name', datafield: 'filename', cellsalign: 'center', align: 'center', width: 100, cellsrenderer: rowfilename  },
    					{ text: 'File Title', datafield: 'title', cellsalign: 'center', align: 'center', width: 100 },
    					{ text: 'Users', width: 'auto', cellsalign: 'left', align: 'center', cellsrenderer: users }
    				],
    			});
    		}
    
    });
    })

    First i initialize my grid, on click on (‘.lang-select’) the localization will change once but not anymore

    is there  any work around?

     

     


    Peter Stoev
    Keymaster

    Hi homam,

    To change the Grid localization, see the jquery-grid-localization.htm. It does not matter how many times you change it.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    homam
    Member

    Hi Peter
    thanks so much for your response.
    i have another problem.
    i want to change my table headers text as well as other localizable parts. is it ppossible or not?

    thanks homam

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.