Note that there are some explanatory texts on larger screens.

plurals
  1. POjqgrid setColProp not working
    primarykey
    data
    text
    <p>I am using setColProp to dynamically load values into a <code>select</code> edittype. </p> <p>I have the values successfully load whenever I call:</p> <pre><code>loadComplete: function() { $("#profile_table").setColProp('contract_num', { editoptions: { value: contract_list} }); }, </code></pre> <p>However it only works here, and only once. If I change the value of <code>contract_list</code> and try to update the jqgrid by calling</p> <pre><code>$("#profile_table").setColProp('contract_num', { editoptions: { value: contract_list} }); </code></pre> <p>again from anywhere (from a button click, from afterSubmit, or even reloading table) it does nothing at all. </p> <p>Is there something that I'm doing wrong?</p> <p><strong>edit: Here is a better explanation of what I'm trying to do.</strong></p> <p>I have a jqGrid table with the id <code>#profile_table</code>. </p> <p>This is part of the <code>colModel</code> in the jqGrid code:</p> <pre><code>colModel:[ {name:'contract_num',index:'contract_num', editable: true, hidden: false, width:30, edittype: "select", editrules: {required: true}}, ] </code></pre> <p>Initially the <code>contract_num</code> edit field in the edit/add forms has no values in its <code>select</code> box. I load initial values from a javascript variable called <code>contract_list</code> that is created before the table gets created. I load these values initially by using:</p> <pre><code>loadComplete: function() { $("#profile_table").setColProp('contract_num', { editoptions: { value: contract_list} }); }, </code></pre> <p>This works fine, however it is possible that the values of <code>contract_list</code> will change whenever a user changes something else on the page that this table is displayed on. So I am trying to dynamically update the options inside of the <code>select</code> box for the <code>contract_num</code> field inside of the edit/add forms for this table. I successfully change the values inside of <code>contract_list</code>, however I cannot get the actual <code>select</code> box to update to the new values. </p> <p>I am trying to update it by calling:</p> <pre><code>$("#profile_table").setColProp('contract_num', { editoptions: { value: contract_list} }); </code></pre> <p>and then reloading the grid whenever someone changes the values for <code>contract_list</code>, however the table is not being updated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload