jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 61 through 75 (of 90 total)
  • Author
    Posts

  • Apeksha Singh
    Participant

    Hi Peter Stoev,

    Please can you share a piece of code using the “getcellvalue” to get the value of a specific Grid cell from an image column and determine allow or disallow editing.
    My image column cell contains image or null value.

    Thanks & Regards,
    Apeksha


    Apeksha Singh
    Participant

    Hi Dimitar,

    As you asked I am adding my code below.

    This is the HTML for tab :-

    <div id='jqxTabs' >
    <ul class="tabbed_font-size" style="margin-left:20%!important;">
    <li>Home</li>
    <li>Accounts</li>
    <li>Reports</li>
    <li>Contacts</li>
    <li>Settings</li>
    <span class="user_section">
    <span id="userNameId">Hello Finapp</span>
    <span> | <a href="#" title="Sign Out" style="font-size:0.9em;">Sign Out</a></span>
    </span>
    </ul>
    <div id="content1" class="content"></div>
    <div id="content2" class="content"></div>
    <div id="content3" class="content"></div>
    <div id="content5" class="content"></div>
    <div id="content4" class="content"></div>
    </div>

    And the script part is :-

    $('#jqxTabs').jqxTabs({  width: '100%',autoheight:true,keyboardNavigation: false,  position: 'top', theme:  'ui-start' });
    //START:Code to display the first view always on click of a tab
    $('#jqxTabs').on('tabclick', function (event)
    {
    var clickedItem = $('#jqxTabs').jqxTabs('getTitleAt', event.args.item);
    switch (clickedItem) {
    case "Home":
    self.goToPage('display_main_dashboard');
    break;
    case "Accounts":
    self.goToPage('display_main_accounts');
    break;
    case "Reports":
    self.goToPage('display_main_reports');
    break;
    case "Contacts":
    self.goToPage('display_main_contacts');
    break;
    case "Settings":
    self.goToPage('display_main_settings');
    break;
    }
    });

    Till now you can see that I am loading different view on each tabclick and it is working fine.
    But if there is another sub tabs in these view , it is also following the main tab click event as mentioned above.
    Why is this happening.
    Please reply me as soon as possible.

    Thanks & Regards,
    Apeksha


    Apeksha Singh
    Participant

    Hi Dimitar,

    Thanks for you reply.

    Regards,
    Apeksha


    Apeksha Singh
    Participant

    Hi Dimitar,

    This examples are not proper according to my requirement.
    Please tell me if I have a select all checkbox in header of a grid column then how I can stop it to select non editable row of the grid.
    I am adding my code below :-

    var source =
    {
    localdata: data,
    datatype: "json",
    datafields:
    [ { name: 'item', type: 'bool' },
    { name: 'id', type: 'number' },
    { name: 'name', type: 'string' },
    { name: 'description', type: 'string' },
    { name: 'purchase_unit_price', type: 'number' },
    { name: 'purchase_chart_id', type: 'string' },
    { name: 'purchase_tax_rate_id', type: 'string' },
    { name: 'sale_unit_price', type: 'number' },
    { name: 'sale_chart_id', type: 'string' },
    { name: 'sale_tax_rate_id', type: 'string' }
    ]
    };
    var cellbeginedit = function (row, datafield, columntype, value) {
    var value = $('#item_table').jqxGrid('getcellvalue', row, "name");
    if (value == "Furniture") {
    return false;
    };
    }
    var cellsrenderer = function (row,columnfield, value, defaulthtml, columnproperties) {
    if (value == "Furniture") {
    return '<span style="color: #A6A6A6;">' + value + '</span>';
    }
    else {
    return '<span style="color: #020202;">' + value + '</span>';
    }
    }
    var dataAdapter = new $.jqx.dataAdapter(source);
    var columnCheckBox = null;
    var updatingCheckState = false;
    // initialize jqxGrid
    $("#item_table").jqxGrid(
    {
    width: '97.7%',
    source: dataAdapter,
    theme:'metro',
    autoheight: true,
    sortable: true,
    altrows: true,
    enabletooltips: true,
    editable:true,
    pageable: true,
    pagesizeoptions: ['10', '20','30','40','50'],
    selectionmode: 'none',
    columns: [
    { text: '', columntype: 'checkbox',datafield: 'item', width: '4%', cellbeginedit: cellbeginedit, renderer: function () {
    return '<div style="margin-left:5px; margin-top: 5px;"></div>';
    },
    rendered: function (element) {
    $(element).jqxCheckBox({ theme: 'metro', width: 16, height: 16, animationShowDelay: 0, animationHideDelay: 0 });
    columnCheckBox = $(element);
    $(element).on('change', function (event) {
    var checked = event.args.checked;
    if (checked == null || updatingCheckState) return;
    var rowscount = $("#item_table").jqxGrid('getdatainformation').rowscount;
    $("#item_table").jqxGrid('beginupdate');
    if (checked) {
    $("#item_table").jqxGrid('selectallrows');
    }
    else if (checked == false) {
    $("#item_table").jqxGrid('clearselection');
    }
    for (var i = 0; i < rowscount; i++) {
    $("#item_table").jqxGrid('setcellvalue', i, 'item', event.args.checked);
    }
    $("#item_table").jqxGrid('endupdate');
    });
    }},
    { text: 'Name', datafield:'name', width:'9%', editable:false ,cellbeginedit: cellbeginedit, cellsrenderer: cellsrenderer},
    { text: 'Id', datafield:'id', width:'9%',editable:false, hidden:true, cellbeginedit: cellbeginedit, cellsrenderer: cellsrenderer},
    { text: 'Description', datafield: 'description', width:'10%',editable:false, cellbeginedit: cellbeginedit, cellsrenderer: cellsrenderer },
    { text: 'Purchases Price', datafield: 'purchase_unit_price', cellsalign: 'right', cellsformat: 'c2', width: '13%',editable:false, cellbeginedit: cellbeginedit, cellsrenderer: cellsrenderer},
    { text: 'Purchases Account', datafield: 'purchase_chart_id', width:'17%',editable:false, cellbeginedit: cellbeginedit, cellsrenderer: cellsrenderer },
    { text: 'Tax', datafield: 'purchase_tax_rate_id', width:'13%',editable:false, cellbeginedit: cellbeginedit, cellsrenderer: cellsrenderer },
    { text: 'Sales Price', datafield: 'sale_unit_price', cellsalign: 'right', cellsformat: 'c2', width: '10%',editable:false, cellbeginedit: cellbeginedit, cellsrenderer: cellsrenderer},
    { text: 'Sales Account', datafield: 'sale_chart_id', width:'12%',editable:false},
    { text: 'Tax', datafield: 'sale_tax_rate_id', width:'12%',editable:false ,cellbeginedit: cellbeginedit, cellsrenderer: cellsrenderer},
    ]
    });

    But in this cellsrenderer function is not working.
    Please guide me regarding this asap.

    Thanks & Regards,
    Apeksha


    Apeksha Singh
    Participant

    Hi,

    I have used the following code to display different views on tabclick event.

     $(’#jqxTabs’).jqxTabs({  width: ’100%’,autoheight:true,keyboardNavigation: false,  position: ‘top’, theme:  ‘ui-start’ });
    $(’#jqxTabs’).on(‘tabclick’, function (event)
    {
    var clickedItem = $(’#jqxTabs’).jqxTabs(‘getTitleAt’, event.args.item);
    switch (clickedItem) {
    case ”Home”:
    self.goToPage(’display_main_dashboard’);
    break;
    case ”Accounts”:
    self.goToPage(’display_main_accounts’);
    break;
    case ”Reports”:
    self.goToPage(’display_main_reports’);
    break;
    case ”Contacts”:
    self.goToPage(’display_main_contacts’);
    break;
    case ”Settings”:
    self.goToPage(’display_main_settings’);
    break;
    }
    });

    But it is creating an issue i.e., every other tabs inside this tab is getting directed to this pages in respect of their index.

    I have used title here to differentiate but then too its creating conflict .

    Please reply me as soon as possible.

    Thanks & Regards,
    Apeksha

    in reply to: Query regarding Tabs Query regarding Tabs #22522

    Apeksha Singh
    Participant

    Hi Dimitar ,

    Thanks for your support no need to reply the above post. I have resolved the issue.

    Thanks & Regards,
    Apeksha


    Apeksha Singh
    Participant

    Hi Dimitar,

    Thanks for your reply.

    Regards,
    Apeksha


    Apeksha Singh
    Participant

    Hi Dimitar,

    Thanks for your reply I executed this code but its not fulfilling my requirement i.e., If I changed value of any grid cell lets suppose I have changed the quantity of first element from 7 to 10 and then close the window.
    If I reopened the window it should show me 7 not 10 as I haven’t saved this changes in database.
    Please guide me regarding this as soon as possible

    Thanks & Regards,
    Apeksha

    in reply to: Query regarding Tabs Query regarding Tabs #22499

    Apeksha Singh
    Participant

    Hi Dimitar ,

    Thanx a lot for your reply.
    I have implemented this in my code according to the requirement, but still facing an issue.The grids that are already added to the tabs is inside a div which even contains buttons an a input field for search items.
    I am adding the html code below for the already added tab :-

    <div id="contact_sub_tabs">
    <ul>
    <li style="margin-left: 30px;">All</li>
    </ul>
    <!--START: Main content for All Accounts tab -->
    <div class="coa_sub_tabs_content">
    <div class="search_header" >
    <div class="search_header_button" >
    <input type="button" value="Change Group" id='all_contact_group' class="changegroup"/>
    <input type="button" value="Archieve" id='all_contact_archieve'/>
    </div>
    <div id="allitem_label" class=" itemcount_value" >
    <label style="cursor:pointer;">0</label>
    </div>
    <div class="itemcount_label" >
    <label> Item selected</label>
    </div>
    <div class="search_div">
    <div>
    <input type="text" class="search" id="all_contact_search"/>
    </div>
    <span>Search</span>
    </div>
    </div>
    <div style="float:left;width:100%;height:auto ! iportant;overflow: hidden;top:-8px!important;">
    <div class="grid_section" id="all_contact"></div>
    </div>
    </div>
    <!--END: Main content for All Accounts tab -->
    </div>

    How can I give the similar look to my dynamically created tab.
    I have tried something and adding that code below :-

    $("#contact_group").jqxButton({ width: '95px',height: '26px', theme: 'ui-redmond' });
    $("#contact_archieve").jqxButton({ width: '80px',height: '26px', theme: 'ui-redmond' });
    $(".contact_search").jqxInput({width: '100px',height: '20px',theme: 'ui-start'});
    $('#contact_sub_tabs').jqxTabs('addAt', grid_index, value, '<div class="coa_sub_tabs_content"><div class="search_header" ><div class="search_header_button"><input type="button" value="Change Group" id="contact_group" class="changegroup"/><input type="button" value="Archieve" id="contact_archieve"/></div><div id="allitem_label" class=" itemcount_value"><label style="cursor:pointer;">0</label></div><div class="itemcount_label"><label> Item selected</label></div><div class="search_div"><div><input type="text" class="search" class="contact_search"/></div><span>Search</span></div></div><div style="float:left;width:100%;height:auto ! iportant;overflow: hidden;top:-8px!important;"><div class="grid_section" id="jqxgrid' + grid_index + '"></div></div></div>');

    But this code is not displaying the jqxButtons.
    Please guide me regarding this as soon as possible.

    Thanks & Regards,
    Apeksha


    Apeksha Singh
    Participant

    Hi Dimitar,

    I can’t update my project to latest version because I have done a lot of changes in .css files.
    Can you just give me any function that can refresh the jqxWindow items on the Close and Cancel buttons of window.

    For example I have a grid in jqxWindow I update some rows in that but didn’t save it and close the window.
    Now if I again open it from the same source without refreshing the page it show me the unsaved updated row.

    Here is my Code that open a window on button click :-

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8" />
    <title>Some code</title>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = $.data(document.body, 'theme', theme);
    if (theme == undefined) theme = '';
    addEventListeners_new_tax();
    createElements_new_tax(theme);
    });
    function addEventListeners_new_tax() {
    //Closed event
    $('#new_tax').bind('close', function (event) {
    displayEvent(event);
    });
    //Dragstarted event
    $('#new_tax').bind('moved', function (event) {
    displayEvent(event);
    });
    //show
    $('#new_tax_button').click(function () {
    $('#new_component_div').html(new_component);
    $('#new_tax').jqxWindow('show');
    });
    }
    function createElements_new_tax(theme) {
    $('#new_tax').jqxWindow({ autoOpen: false, height: '300px', width: '47%',
    theme: 'ui-start', resizable: false, isModal: true,position: { x: 300, y: 100 }, modalOpacity: 0.3,
    cancelButton: $('#new_tax_cancel'),
    okButton: $('#new_tax_save'),
    initContent: function () {
    $('#new_tax_save').jqxButton({ theme: 'ui-le-frog', width: '70px',height:'28px' });
    $('#new_tax_cancel').jqxButton({ theme: 'ui-smoothness', width: '70px',height:'28px' });
    }
    });
    }
    // END:- jqxWindow widgets for new tax rate popup form.
    // Create a jqxInput
    $("#name").jqxInput({width:'150px',height:'18px',theme: 'ui-start'});
    $("#component_1").jqxInput({ width:'160px',height:'18px',theme: 'ui-start'});
    $("#rate_1").jqxInput({ width:'56%',height:'18px',theme: 'ui-start'});
    $("#component_2").jqxInput({ width:'160px',height:'18px',theme: 'ui-start'});
    $("#rate_2").jqxInput({ width:'56%',height:'18px',theme: 'ui-start'});
    $("#component_3").jqxInput({ width:'160px',height:'18px',theme: 'ui-start'});
    $("#rate_3").jqxInput({ width:'56%',height:'18px',theme: 'ui-start'});
    $("#component_4").jqxInput({ width:'160px',height:'18px',theme: 'ui-start'});
    $("#rate_4").jqxInput({ width:'56%',height:'18px',theme: 'ui-start'});
    $("#component_5").jqxInput({ width:'160px',height:'18px',theme: 'ui-start'});
    $("#rate_5").jqxInput({ width:'56%',height:'18px',theme: 'ui-start'});
    $("#component_6").jqxInput({ width:'160px',height:'18px',theme: 'ui-start'});
    $("#rate_6").jqxInput({ width:'56%',height:'18px',theme: 'ui-start'});
    // Create a jqxButton widget for ADD COMPONENT INPUT FIELDS.
    $("#add_component").jqxButton({ width: '140', theme: 'ui-redmond' });
    // Subscribe to Click events.
    var i=0;
    $("#add_component").bind('click', function (){
    i++;
    switch (i) {
    case 1:
    $('#new_tax').jqxWindow({ autoOpen: false, height: '430px'});
    $("#display_check_box").css("display","inline-block");
    $("#delete_component").css("display","inline-block");
    $(".display_base_total").css("display","inline-block");
    $(".total_tax").css("margin-left", "57%");
    $("#display_repeat_field1").css(" width", "99%");
    $("#display_repeat_field1").css("display","inline-block");
    break;
    case 2:
    $("#display_repeat_field2").css(" width", "99%");
    $("#display_repeat_field2").css("display","inline-block");
    break;
    case 3:
    $("#display_repeat_field3").css(" width", "99%");
    $("#display_repeat_field3").css("display","inline-block");
    break;
    case 4:
    $("#display_repeat_field4").css(" width", "99%");
    $("#display_repeat_field4").css("display","inline-block");
    break;
    case 5:
    $("#display_repeat_field5").css(" width", "99%");
    $("#display_repeat_field5").css("display","inline-block");
    break;
    default:
    $('#add_component').jqxButton({disabled: true });
    }
    });
    //To unselect the selected radio button
    $("input[type='radio']").click(function()
    {
    var previousValue = $(this).attr('previousValue');
    var name = $(this).attr('name');
    if (previousValue == 'checked')
    {
    $(this).removeAttr('checked');
    $(this).attr('previousValue', false);
    }
    else
    {
    $("input[name="+name+"]:radio").attr('previousValue', false);
    $(this).attr('previousValue', 'checked');
    }
    });
    // Create a add and deleteButton
    $("#new_tax_button").jqxButton({width: '110px',height: '29px',theme:'ui-redmond'});
    var tax = [
    "Sales Tax",
    "Service Tax",
    "Other Tax"
    ];
    $("#tax_type_id").jqxComboBox({ source: tax, selectedIndex: 1, width: '120', height: '20', theme: 'ui-start' });
    </script>
    </head>
    <body>
    <div class="form_heading"><label>Tax Rates</label></div> <!--Code for main heading -->
    <!-- START: code for main content -->
    <div class="settings_main_content">
    <div class="settings_main_buttons">
    <div style="width:120px;">
    <input type="button" value="New Tax Rate" id='new_tax_button' />
    </div>
    </div>
    </div>
    <!-- END: code for main content -->
    <!--START :add new tax rate popup form -->
    <div id="new_tax">
    <div>Add New Tax Rate</div>
    <div style="overflow-y: hidden;">
    <form style="overflow-y: hidden;">
    <div style="margin-left: 10px;">
    <label style="font-weight:bold;">Tax Rate Display Name</label>
    <label style="font-weight:bold;float:right;margin-right:2%;">Tax Type</label>
    </div>
    <div style="margin-left: 10px;">
    <label style="color:#8E8B84;">The name as you would like it to appear in Xero (limited to 50 characters)</label>
    </div>
    <div style="margin-left: 10px;margin-top:1%;">
    <input name="name" type="text" id="name"/>
    <div style="float:right;margin-right:2%;" id="tax_type_id"></div>
    </div>
    <div style="margin-left: 10px;margin-top:2%;"><label style="font-weight:bold;">Base Rate</label></div>
    <div id="new_component_div" class="component_div">
    <div id="new_component" class="component_div_section">
    <div style="float:left;margin-left:10px;margin-top:3px;">
    <input name="component_1" type="text" id="component_1"/>
    </div>
    <div id="display_check_box" class="radio_button" style="display:none;">
    <label><input type='radio' name='compound' value='Compound1'/>Compound</label>
    </div>
    <div class="tax_components_rate">
    <input name="rate_1" type="text" id="rate_1"/><label style="color:#8E8B84;">%</label>
    </div>
    <div id="delete_component" style="cursor:pointer;display:none;">
    <img src='images/close.png' alt='Delete this tax component' style='margin-top:1%;'>
    </div>
    </div>
    </div>
    <div id="display_repeat_field1" class="component_div" style="display:none;">
    <div class="component_div_section">
    <div style="float:left;margin-left:10px;margin-top:3px;">
    <input name="component_2" type="text" id="component_2"/>
    </div>
    <div class="radio_button">
    <label><input type='radio' name='compound' value='Compound2'/>Compound</label>
    </div>
    <div class="tax_components_rate">
    <input name="rate_2" type="text" id="rate_2"/><label style="color:#8E8B84;">%</label>
    </div>
    <div style="cursor:pointer;">
    <img src='images/close.png' alt='Delete this tax component' style='margin-top:1%;'>
    </div>
    </div>
    </div>
    <div id="display_repeat_field2" class="component_div" style="display:none;">
    <div class="component_div_section">
    <div style="float:left;margin-left:10px;margin-top:3px;">
    <input name="component_3" type="text" id="component_3"/>
    </div>
    <div class="radio_button">
    <label><input type='radio' name='compound' value='Compound3'/>Compound</label>
    </div>
    <div class="tax_components_rate">
    <input name="rate_3" type="text" id="rate_3"/><label style="color:#8E8B84;">%</label>
    </div>
    <div style="cursor:pointer;">
    <img src='images/close.png' alt='Delete this tax component' style='margin-top:1%;'>
    </div>
    </div>
    </div>
    <div id="display_repeat_field3" class="component_div" style="display:none;">
    <div class="component_div_section">
    <div style="float:left;margin-left:10px;margin-top:3px;">
    <input name="component_4" type="text" id="component_4"/>
    </div>
    <div class="radio_button">
    <label><input type='radio' name='compound' value='Compound4'/>Compound</label>
    </div>
    <div class="tax_components_rate">
    <input name="rate_4" type="text" id="rate_4"/><label style="color:#8E8B84;">%</label>
    </div>
    <div style="cursor:pointer;">
    <img src='images/close.png' alt='Delete this tax component' style='margin-top:1%;'>
    </div>
    </div>
    </div>
    <div id="display_repeat_field4" class="component_div" style="display:none;">
    <div class="component_div_section">
    <div style="float:left;margin-left:10px;margin-top:3px;">
    <input name="component_5" type="text" id="component_5"/>
    </div>
    <div class="radio_button">
    <label><input type='radio' name='compound' value='Compound5'/>Compound</label>
    </div>
    <div class="tax_components_rate">
    <input name="rate_5" type="text" id="rate_5"/><label style="color:#8E8B84;">%</label>
    </div>
    <div style="cursor:pointer;">
    <img src='images/close.png' alt='Delete this tax component' style='margin-top:1%;'>
    </div>
    </div>
    </div>
    <div id="display_repeat_field5" class="component_div" style="display:none;border-bottom:1px solid #CCCCCC;">
    <div class="component_div_section">
    <div style="float:left;margin-left:10px;margin-top:3px;">
    <input name="component_6" type="text" id="component_6"/>
    </div>
    <div class="radio_button">
    <label><input type='radio' name='compound' value='Compound6'/>Compound</label>
    </div>
    <div class="tax_components_rate">
    <input name="rate_6" type="text" id="rate_6"/><label style="color:#8E8B84;">%</label>
    </div>
    <div style="cursor:pointer;">
    <img src='images/close.png' alt='Delete this tax component' style='margin-top:1%;'>
    </div>
    </div>
    </div>
    <div style="width:99%;height:60px;">
    <div class='add_component'>
    <input type="button" value="Add a Component" id='add_component' />
    </div>
    <div class="base_rate display_base_total" style="display:none;">
    <label>Effective tax rate :</label>
    <label>0.00%</label>
    </div>
    <div class="base_rate total_tax">
    <label>Total tax rate : </label>
    <label>0.00%</label>
    </div>
    </div>
    <div style="float: left; margin-top:20px;margin-left: 10px;">
    <input type="button" id="new_tax_save" value="Save" style="margin-right: 10px" />
    <input type="button" id="new_tax_cancel" value="Cancel" />
    </div>
    </form>
    </div>
    </div>
    <!--END :ADD new tax rate popup form -->
    </body>
    </html>

    Please reply as soon as possible.

    Thanks & Regards,
    Apeksha

    in reply to: Query regarding Tab Query regarding Tab #22428

    Apeksha Singh
    Participant

    Hi Peter,

    I have used the following code to display different views on tabclick event.

               $('#main_tabs').jqxTabs({  width: '100%',autoheight:true,keyboardNavigation: false,  position: 'top', theme:  'ui-start' });
    $('#main_tabs').on('tabclick', function (event)
    {
    var clickedItem = $('#main_tabs').jqxTabs('getTitleAt', event.args.item);
    switch (clickedItem) {
    case "Home":
    self.goToPage('display_main_dashboard');
    break;
    case "Accounts":
    self.goToPage('display_main_accounts');
    break;
    case "Reports":
    self.goToPage('display_main_reports');
    break;
    case "Contacts":
    self.goToPage('display_main_contacts');
    break;
    case "Settings":
    self.goToPage('display_main_settings');
    break;
    }
    });

    It is fulfilling my requirement but creating an issue i.e., Every other tabs inside this tab is going to this pages in respect of their index.
    I have used string here but then too its creating conflict .

    Please reply me as soon as possible.

    Thanks & Regards,
    Apeksha


    Apeksha Singh
    Participant

    Hello Peter Stoev,

    I want to update the combobox source everytime I open it.

    Please reply me as soon as possible.

    Thanks & Regards,

    Apeksha

    in reply to: Query regarding Tabs Query regarding Tabs #22416

    Apeksha Singh
    Participant

    Hi Dimitar,

    I have re-posted my code and formatted it as explained in the forum topic Code Formatting.

    Please review the above post and guide me as soon as possible.

    Thanks & Regrads,
    Apeksha

    in reply to: Query regarding Tabs Query regarding Tabs #22413

    Apeksha Singh
    Participant

    Hi Dimitar,

    I have reposted my and also formated it as explained in the forum topic Code Formatting.
    Please see the above post and reply me as soon as possible.

    Thanks & Regards,
    Apeksha

    in reply to: Query regarding Grid. Query regarding Grid. #22399

    Apeksha Singh
    Participant

    Hi Peter,

    This is the code for the grid that contain checkbox column :

                        var source =
    {
    localdata: data,
    datatype: "json",
    datafields:
    [ { name: 'item', type: 'bool' },
    { name: 'id', type: 'number' },
    { name: 'name', type: 'string' },
    { name: 'description', type: 'string' },
    { name: 'purchase_unit_price', type: 'number' },
    { name: 'purchase_chart_id', type: 'string' },
    { name: 'purchase_tax_rate_id', type: 'string' },
    { name: 'sale_unit_price', type: 'number' },
    { name: 'sale_chart_id', type: 'string' },
    { name: 'sale_tax_rate_id', type: 'string' }
    ]
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    var columnCheckBox = null;
    var updatingCheckState = false;
    // initialize jqxGrid
    $("#item_table").jqxGrid(
    {
    width: '97.7%',
    source: dataAdapter,
    theme:'metro',
    autoheight: true,
    sortable: true,
    altrows: true,
    enabletooltips: true,
    editable:true,
    pageable: true,
    selectionmode: 'none',
    columns: [
    { text: '', columntype: 'checkbox',datafield: 'item', width: '4%', renderer: function () {
    return '<div style="margin-left:5px; margin-top: 5px;"></div>';
    },
    rendered: function (element) {
    $(element).jqxCheckBox({ theme: 'metro', width: 16, height: 16, animationShowDelay: 0, animationHideDelay: 0 });
    columnCheckBox = $(element);
    $(element).on('change', function (event) {
    var checked = event.args.checked;
    if (checked == null || updatingCheckState) return;
    var rowscount = $("#item_table").jqxGrid('getdatainformation').rowscount;
    $("#item_table").jqxGrid('beginupdate');
    if (checked) {
    $("#item_table").jqxGrid('selectallrows');
    }
    else if (checked == false) {
    $("#item_table").jqxGrid('clearselection');
    }
    for (var i = 0; i < rowscount; i++) {
    $("#item_table").jqxGrid('setcellvalue', i, 'item', event.args.checked);
    }
    $("#item_table").jqxGrid('endupdate');
    });
    }},
    { text: 'Name', datafield:'name', width:'9%', editable:false},
    { text: 'Id', datafield:'id', width:'9%',editable:false, hidden:true},
    { text: 'Description', datafield: 'description', width:'10%',editable:false },
    { text: 'Purchases Price', datafield: 'purchase_unit_price', cellsalign: 'right', cellsformat: 'c2', width: '13%',editable:false},
    { text: 'Purchases Account', datafield: 'purchase_chart_id', width:'17%',editable:false },
    { text: 'Tax', datafield: 'purchase_tax_rate_id', width:'13%',editable:false },
    { text: 'Sales Price', datafield: 'sale_unit_price', cellsalign: 'right', cellsformat: 'c2', width: '10%',editable:false},
    { text: 'Sales Account', datafield: 'sale_chart_id', width:'12%',editable:false},
    { text: 'Tax', datafield: 'sale_tax_rate_id', width:'12%',editable:false},
    ]
    });

    You can see that I have a checkbox in the header of 1st column that select all row and deselect it.
    I want that it does not select any non editable row.

    Please guide me regarding this as soon as possible.

    Thanks & Regards,
    Apeksha

Viewing 15 posts - 61 through 75 (of 90 total)