Bootstrap table checking - bootstrap-table

I was trying to check a row inside a Bootstrap table using this function:
$('#editMappingTable').bootstrapTable('check', var);
var is dynamic variable(number) which will have the row id I want to check but its not working.
If I use this technique :
$('#editMappingTable').bootstrapTable('check', 1);
the above one works well .
What should I do?

Please make sure that you are passing a valid row index

Related

How to make a row in a grid not appear if it's value is 0?

I only have two fields in my grid. Just need the entire row to not appear, if the value in one of the fields is 0.
There are multiple solutions for your need, but this one is working for me in a similar setup.
Following code is in the PostBuild event of the component:
Local Rowset &rs;
&rs = GetLevel0()(1).GetRowset(Scroll.MainRecordOfTheGrid);
&rs.Flush();
&rs.Select(Record.MainRecordOfTheGrid, "WHERE FieldA<>0 and FieldB<>0");

How to keep ranges on form datasource when manually add filters?

I have a strange problem on form: I added a range to filter records in datasource executeQuery() method, this works fine when opening form but if I set manually a filter in the grid header, the range set in ExecuteQuery() method are not applied. My ranges are definied as follow :
this.query.dataSourceNo(1).AddRange(fieldnum(MyTable,MyField)).Value('MyRangeValue');
I use a view as form DataSource, May be it's the problem.
Any ideas to always apply ranges and keep it even when manually add filters on grid?
Thanks for your help
You must apply the filter before the super() in executeQuery().
But I think your problem is you add the filter every time the executeQuery() is run, resulting in an OR in the SQL expression generated.
This is the way to do it:
QueryBuildRange qr = SysQuery::findOrCreateRange(this.query.dataSourceNo(1), fieldnum(MyTable,MyField));
qr.value(queryValue('MyRangeValue'));
qr.status(RangeStatus::Locked); // Or ::Hidden

Drupal 6 | Flexifields remove option

I've used flexifield module to merge two of my content types. There is an option to add an item while creating a node. I want to remove rows added. I've been searching and trying to get out of this problem but found nothing. What should be done to achieve this thing?
Thanks
Set all the field value as default. It will remove extra rows and by default it will give two sets of row.

ExtJs / Sencha : how to highlight a grid row after insert?

I want to create such a grid:
http://www.sencha.com/deploy/dev/examples/grid/edit-grid.html
Actually I already did, but I want to highlight the last inserted row of my grid (in extjs this is the function highlight(), which does a yellowfade on the element).
I didn't actually succeed in doing this... my problem is that I can't get the row I just inserted, and thus obviously I can't highlight it.
Any clues?
Thanks in advance
You only need to do this (here for row number one):
var row = grid.getView().getRow(0);
Ext.get(row).highlight();
It's that easy.
The code has
store.insert(0, p);
So don't you just highlight row zero immediately after that statement?
yes sorry for answering too late,
use Ext.grid.RowSelectionModel and than use selectLastRow function u can easily will be able to point it out :)
Ext.data.store has a add listener which is passed an index at which records were inserted
add : ( Store this, Ext.data.Record[] records, Number index )
This would go inside of your add/create button event. The code this.getSelectionModel().select(0); will highlight the first row since we inserted into position 0, we are selecting position 0. This code works with ExtJS 4.2.0.
var rec = Ext.create('App.model.GridModel', {
id: '123',
name: 'ABC'
});
this.store.insert(0, rec);
this.getSelectionModel().select(0);

How do you get a Min() or Max() in drupal using views?

I'm using Drupal's Views 2, and need to retrieve min values from fields in a custom table. The query for this is easy if I were writing it by hand--something like, "SELECT foo, min(bar) FROM table GROUP BY foo." But how would I do this using Views? I've already defined the table in a views.info file, so there's no trouble getting views to see the table. It's the Min() part of the query I just don't understand. My next stop will be the Views API documentation, but if someone can just provide the outline for how to do this quickly, I would greatly appreciate it.
New answer to an old question, but something like this will work. You need to create a custom field handler and then wrap the field as follows:
class views_handler_custom_field extends views_handler_field {
function query() {
$this->ensure_my_table();
$this->field_alias = $this->query->add_field("MAX({$this->table_alias}", "{$this->real_field})",$this->table_alias . "_" . $this->real_field);
}
}
Use aggregation from advanced configuration of views. After this is set
yes you can select max, min or any other selector to fields.
Test your results but it should work well
Alternatively in some cases you can sort your data ascending or
descending and then just pick one to be shown on the view. Can be
problematic when displaying multiple fields or so.
After testing first one seems to be faster at least on small scale.
One could consider the modules groupby and views_calc, but I assume they are not acceptable for you.
Additionally, you can accomplish this with a custom module.

Resources