jqGridImport is not a function
On version 5.3.2, when I try to call the jqGridImport function, it cannot be found. But jqGridExport works just fine.
$('#myGrid').jqGrid('jqGridImport', options)
or
$('#myGrid').jqGridImport(options)
According to the Import/Export documentation it should work just fine.
It seems to me that you use the Guriddo jqGrid, but read the old docs for jqGrid <=4.7
The correct linkt is Guriddo documentation
With simple word you will need not to apply the method to the grid, but pass the id as parameter to it. Try:
$.jgrid.jqGridImport( "#myGrid", options );
Related
So I have a case where I need to be able to work on the actual Hyperlink element inside the body of the docx, not just the target URL or the internal/externality of the link.
As a possible additional wrinkle this hyperlink wasn't present in the docx when it was opened but instead was added by the docx4j-xhtmlImporter.
I've iterated the list of relationships here: wordMLPackage.getMainDocumentPart().getRelationshipsPart().getRelationships().getRelationship()
And found the relationship ID of the hyperlink I want. I'm trying to use an XPath query: List<Object> results = wordMLPackage.getMainDocumentPart().getJAXBNodesViaXPath("//w:hyperlink[#r:id='rId11']", false);
But the list is empty. I also thought that it might need a refresh because I added the hyperlink at runtime so I tried with the refreshXMLFirst parameter set to true. On the off chance it wasn't a real node because it's an inner class of P, I also tried getJAXBAssociationsForXPath with the same parameters as above and that doesn't return anything.
Additionally, even XPath like "//w:hyperlink" fails to match anything.
I can see the hyperlinks in the XML if I unzip it after saving to a file, so I know the ID is right: <w:hyperlink r:id="rId11">
Is XPath the right way to find this? If it is, what am I doing wrong? If it's not, what should I be doing?
Thanks
XPathHyperlinkTest.java is a simple test case which works for me
You might be having problems because of JAXB, or possibly because of the specific way in which the binder is being set up in your case (do you start by opening an existing docx, or creating a new one?). Which docx4j version are you using?
Which JAXB implementation are you using? If its the Sun/Oracle implementation (the reference implementation, or the one included in their JDK/JRE), it might be this which is causing the problem, in which case you might try using MOXy instead.
An alternative to using XPath is to traverse the docx; see finders/ClassFinder.java
Try without namespace binding
List<Object> results = wordMLPackage.getMainDocumentPart().getJAXBNodesViaXPath("//*:hyperlink[#*:id='rId11']", false);
I have used this option in the pager widget (so I used pager_processAjaxOnInit: false), but can't tell that it has an effect. I thought it might cause the ajaxProcessing option to not run upon initial loading of the table, but that doesn't seem to be the case.
Thanks for your help.
The documentation states:
Set this option to false if your table data is preloaded into the table, but you are still using ajax (New v2.14.5).
For more details see issue #424.
I'm working on importing (on a regular basis) about 6,000 items into Magento using Magmi. I've got nearly everything configured the way I need it, but I have one issue.
I need to concatenate 3 columns from my .csv file to create a "category_ids" column. I'm using the Value Replacer plugin with the following value:
{item.departmentid},{item.classid},{item.subclassid}
This works well, however I need to then map this field to another field using the Generic Mapper plugin. Both functions work individually, however I need the Value Replacer to run BEFORE the Generic Mapper. As best as I can tell, it appears the Generic Mapper runs first. Is there a way I can alter the execute order for these two plugins?
Thanks for the help!
Update for Dweeves:
Doh! I totally overlooked that section while trying to figure this out. Now that I've gone through it, I might need a little more help. Right now I've using just the Value Replacer plugin with the following settings:
Replaced attributes: category_ids
New value for category_ids:
{{ ValueRemapper::use_csv('/var/www/magmi/category_ids.csv')->map({item.departmentid},{item.classid},{item.subclassid}) }}
It doesn't seem to be working as I intended it to, but I'm a systems guy and not a PHP programmer. Any help?
2nd Edit
I got it working by using the Value Replacer function to first concatenate everything into a new "test" column, then using the Value Replacer Value Mapper function to create the category_ids column with the mapped values. Confusing, but it's working well.
You can use the ValueRemapper helper of Value Replacer plugin for this kind of purpose.
See Value Replacer Plugin Documentation (ValueRemapper helper section)
To answer your original question (how to define the order the plugins run in).
From my experience, the plugins are loaded in order of their plugin filename.
For example, if you look at magmi/plugins/base/itemprocessors/importlimiter, you will notice that the filename for the plugin is 01_importlimiter.php.
If you look in the genericmapper plugin folder, you'll notice the plugin filename to be 02_genericmapper.php.
With this being said, 01_importlimiter.php will execute before 02_genericmapper.php.
I have seen many people referring to the usage of call_user_func() to debug the problems in a Grocery_CRUD callback, but unfortunately no one has come off with a complete example to actually how to use it like where to to place a call to the test function [just_a_test()] in the controller an example of what I am trying to discover is here.
I am unable to understand where do we call this
just_a_test(),
how are we able to pass on the desired parameters using call_user_func(array($this,'insert_coupon_codes')); when there are no para's being passed to the just_a_test()?
how come the insert_coupon_codes will be able to get the desired para's?
Grocery CRUD add the parameters automatically from the library. You are not able (till now at version 1.1.8) to add more parameters at your callback.
Update: At the latest version of Grocery CRUD now you CAN pass as many parameters as you need. This is a functionality that PHP is offering from version PHP 5.4 or later. More specifically with the use keyword. More specifically if you have the callback callback_after_insert:
usually you would use it like this:
$crud->callback_after_insert(function ($post_array,$primary_key) {
// Your code here
});
From PHP 5.4 version and later you can add more parameters with the use so for example you could have:
$my_variable = 'test';
$another_variable = 'hello';
$crud->callback_after_insert(function ($post_array,$primary_key) use ($my_variable, $another_variable) {
// Now you can use the variables $my_variable and $another_variable at your callback
});
I have a problem to use subgrid. I want to use the nice feature of loadoce(local search etc.). And I also want to use subgrid.
But it doen't work to put them together. I don't know if it's a bug or I miss some thing.
If I set loadonce:false, the subgrid works.
I tried both 3.7.1 and 3.7.2
Or should I only use one at a time?
Many thanks!
This is possible in JQGrid 3.8, at least - and 4.0 (I have not tried JQGrid < 3.8).
Please be certain to have your subGridType set, if you want to be using loadonce:true, as that'll override the change from datatype:X(where X is what you set it to) to datatype:local(for your subgrid). You probably know you'll have to set editUrl:clientArray for the local searches to work.
An example from a grid where I'm using the settings you want:
jQuery("#MyGrid").jqGrid({
colNames:['Customer','Value.','Customer ID']
,colModel:[
{name:'customer_name',index:'customer_name',sortable:true},
{name:'value',index:'value',sortable:true,align:'right',width:'100px',formatter:'number',formatoptions:{decimalSeparator:',',thousandsSeparator:'.',decimalPlaces:1,defaultValue:'0.00'}},
{name:'customer_id',index:'customer_id',hidden:true}]
,sortname:'customer_id'
,caption:'mycap'
,datatype:'json'
,loadonce:true
,rowNum:100
,footerrow:true
,pager:false
,userDataOnFooter:true
,sortorder:'asc'
,subGrid:true
,sortable:true
,height:'auto'
,viewrecords:true
,subgridtype:'json'
,url:'?q=1'
,editurl:'?q=1&p=1'
,autowidth:true
,altRows:true
,shrinkToFit:true
,subGridUrl:'/myurl?q=1&sub=1'
,subGridModel:[{name:['Additional Info','Subtotal'],width:[170,60],params:['customer_id']}]
});