Tumgik
#propkey
Text
Tumblr media
On National Army Day, we convey our best wishes to all army personnel, veterans and their families. Every Indian is proud of our Army and will always be grateful to our soldiers
#NationalArmyDay#propkeysconsulting#propkeys#realestateinvesting
0 notes
propkey-blog · 8 years
Photo
Tumblr media
Ramky One Kosmos is a residential project constructed by Ramky Estates & Farms Limited, with a well-developed social infrastructure and offering luxurious 1635 Sq. ft., 3 BHK flats with East facing and the project is spread over 13.46 Acres. Ramky One Kosmos is located at Nallagandla, Gachibowli ensures the world-class amenities, and the project is set in the fastest growing residential Hub of Hyderabad near the IT hub, Financial District.
For More @ http://ramkyonekosmos.propkey.co.in/
0 notes
suzanneshannon · 5 years
Text
Wrap a Vanilla JavaScript Package for Use in React
Complex web projects often require the use of 3rd party widgets. But what if you're using a framework while a widget is only available in pure JavaScript?
To use a JavaScript widget in your project, the best approach would be to create a framework specific wrapper. That's what this article is about.
At ag-Grid we focus on developing the fastest and most feature rich JavaScript data grid for web applications. It has no 3rd party dependencies and is specifically designed to deliver outstanding performance even if being used to display millions of records. To make integrations with React applications easier, we've implemented our own React grid wrapper.
In this article, I'll show you how to wrap a 3rd party widget into a React component using ag-Grid as an example. I'll show you how we set up the mapping between React Props and the widget's configuration options. You'll also learn how to expose a widget's API through a React component.
Understanding the JS Widget: Defining things to bridge
Most widgets can be configured through configuration options. Usually they also define public API and broadcasts events.
In general, most widgets have:
Configuration options
A public API
Broadcasted events
That's exactly how you interact with ag-Grid. You can find a good description for the grid's properties, events, callbacks and API here. In short, the datagrid defines:
Grid Properties that enable features of the grid, like row animation.
Grid API to interact with the grid at runtime, e.g. to get all the selected rows
Grid Events emitted by the grid when certain events happen in the grid, like row sorting or rows selection
Grid Callbacks used to supply information from your application to the grid when it needs it, e.g. a callback is called each time a menu is shown that allows your application to customize the menu.
Here's a very basic pure JavaScript configuration that demonstrates the usage of grid options:
let gridOptions = { // PROPERTIES - object properties, myRowData and myColDefs are created somewhere in your application rowData: myRowData, columnDefs: myColDefs, // PROPERTIES - simple boolean / string / number properties pagination: true, rowSelection: 'single', // EVENTS - add event callback handlers onRowClicked: function(event) { console.log('a row was clicked'); }, onColumnResized: function(event) { console.log('a column was resized'); }, onGridReady: function(event) { console.log('the grid is now ready'); }, // CALLBACKS isScrollLag: function() { return false; } }
Once the JavaScript data grid is initialized like this:
new Grid(this._nativeElement, this.gridOptions, ...);
ag-Grid attaches the object with API methods to the gridOptions that can be used to control the JavaScript data grid:
// get the grid to refresh gridOptions.api.refreshView();
However, when ag-Grid is used as a React component, we don't instantiate the datagrid directly. That's the job of the wrapper component.
All interactions with the instance of ag-Grid occurs through the component instance. For example, we don't have direct access to the API object attached by the grid. We will access it through the component's instance.
What should a wrapper component do?
We never pass configuration options and callbacks directly to the grid.
A React wrapper component takes the options and callbacks through React Props.
All grid options that are available for vanilla JavaScript grid should be available in React datagrid as well. We also don't directly listen for events on the instance of ag-Grid. If we're using ag-Grid as a React component, all events emitted by ag-Grid should be available through React components props.
This all means that a React specific datagrid wrapper around ag-Grid should:
implement a mapping between input bindings (like rowData) and ag-Grid's configuration options.
should listen for events emitted by ag-Grid and define them as component outputs
listen for changes in component's input bindings and update configuration options in the grid
expose API attached by ag-Grid to the gridOptions through its properties
The following example demonstrates how React datagrid is configured in a template using React Props:
<AgGridReact // useful for accessing the component directly via ref ref="agGrid" // these are simple attributes, not bound to any state or prop rowSelection="multiple" // these are bound props, so can use anything in React state or props columnDefs={this.props.columnDefs} showToolPanel={this.state.showToolPanel} // this is a callback isScrollLag={this.myIsScrollLagFunction.bind(this)} // these are registering event callbacks onCellClicked={this.onCellClicked.bind(this)}" onColumnResized={this.onColumnEvent.bind(this)}" onGridReady={this.onGridReady.bind(this)}" // inside onGridReady, you receive the grid APIs if you want them />
Now that we understand the requirement, let's see how we implemented it at ag-Grid.
React Wrapper Implementation
First, we need to define a React component AgGridReact that represents our React data grid in templates. This component will render a DIV element that will serve as a container for the datagrid. To get a hold of the native DIV element we use the Refs functionality:
export class AgGridReact extends React.Component { protected eGridDiv: HTMLElement; render() { return React.createElement("div", { style: ..., ref: e => { this.eGridDiv = e; } }, ...); } }
Before we can instantiate ag-Grid, we also need to collect all options. All ag-Grid properties and events come as React Props on the AgGridReact component. The gridOptions property is used to store all datagrid options. We need to copy all configuration options from React props as soon as they become available.
To do that, we've implemented the copyAttributesToGridOptions function. It's just a utility function that copies properties from one object to the other. Here's the gist of the function:
export class ComponentUtil { ... public static copyAttributesToGridOptions(gridOptions, component, ...) { ... // copy all grid properties to gridOptions object ComponentUtil.ARRAY_PROPERTIES .concat(ComponentUtil.STRING_PROPERTIES) .concat(ComponentUtil.OBJECT_PROPERTIES) .concat(ComponentUtil.FUNCTION_PROPERTIES) .forEach(key => { if (typeof component[key] !== 'undefined') { gridOptions[key] = component[key]; } }); ... return gridOptions; } }
The options are copied in the componentDidMount lifecycle method after all props have been updated. This is also the hook where we instantiate the grid. We need to pass a native DOM element to the data grid when it's being instantiated, so we'll use the DIV element captured using refs functionality. Here's how it all looks:
export class AgGridReact extends React.Component { gridOptions: AgGrid.GridOptions; componentDidMount() { ... let gridOptions = this.props.gridOptions || {}; if (AgGridColumn.hasChildColumns(this.props)) { gridOptions.columnDefs = AgGridColumn.mapChildColumnDefs(this.props); } this.gridOptions = AgGrid.ComponentUtil.copyAttributesToGridOptions(gridOptions, this.props); new AgGrid.Grid(this.eGridDiv, this.gridOptions, gridParams); this.api = this.gridOptions.api; this.columnApi = this.gridOptions.columnApi; } }
You can see above that we also check if there are children that are passed as columns and add then to configuration options as column definitions:
if (AgGridColumn.hasChildColumns(this.props)) { gridOptions.columnDefs = AgGridColumn.mapChildColumnDefs(this.props); }
Synchronizing grid properties updates
Once the grid is initialized, we need to track changes to React Props to update configuration options of the datagrid. ag-Grid implements API to do that, for example, if the headerHeight property changes there's the setHeaderHeight method to update the height of a header.
React uses componentWillReceiveProps lifecycle method to notify a component about changes. This is where we put our update logic:
export class AgGridReact extends React.Component { componentWillReceiveProps(nextProps: any) { const changes = <any>{}; const changedKeys = Object.keys(nextProps); changedKeys.forEach((propKey) => { ... if (!this.areEquivalent(this.props[propKey], nextProps[propKey])) { changes[propKey] = { previousValue: this.props[propKey], currentValue: nextProps[propKey] }; } }); AgGrid.ComponentUtil.getEventCallbacks().forEach((funcName: string) => { if (this.props[funcName] !== nextProps[funcName]) { changes[funcName] = { previousValue: this.props[funcName], currentValue: nextProps[funcName] }; } }); AgGrid.ComponentUtil.processOnChange(changes, this.gridOptions, this.api, this.columnApi); } }
Basically we go over the list of ag-Grid's configuration properties and callbacks and check if any of them have changed. We put all changes in the changes array and then process them using processOnChange method.
The method does two things. First, it goes over the changes in React Props and updates properties on the gridOptions object. Next, it calls API methods to notify the grid about the changes:
export class ComponentUtil { public static processOnChange(changes, gridOptions, api, ...) { ... // reflect the changes in the gridOptions object ComponentUtil.ARRAY_PROPERTIES .concat(ComponentUtil.OBJECT_PROPERTIES) .concat(ComponentUtil.STRING_PROPERTIES) .forEach(key => { if (changes[key]) { gridOptions[key] = changes[key].currentValue; } }); ... // notify Grid about the changes in header height if (changes.headerHeight) { api.setHeaderHeight(changes.headerHeight.currentValue); } // notify Grid about the changes in page size if (changes.paginationPageSize) { api.paginationSetPageSize(changes.paginationPageSize.currentValue); } ... } }
Exposing API
Interacting with the React grid at run time is done through the grid API. You may want to adjust the columns size, set new data source, get a list of all selected rows etc. When the JavaScript datagrid is initiated, it attaches the api object to the grid options object. To expose this object, we simply assign it to the component instance:
export class AgGridReact extends React.Component { componentDidMount() { ... new AgGrid.Grid(this.eGridDiv, this.gridOptions, gridParams); this.api = this.gridOptions.api; this.columnApi = this.gridOptions.columnApi; } }
And that's it.
Wrap a Vanilla JavaScript Package for Use in React published first on https://deskbysnafu.tumblr.com/
0 notes
Text
Tumblr media
Godrej Launching New Tower #THRIVE at Godrej Nurture Sector 150 Noida
Price starting from ₹1.46 Cr*
For More Details: +91-8287742630 or visit www.prop-keys.com
Official Associate Partner: Prop-Keys Consulting Pvt Ltd
2 notes · View notes
Text
Tumblr media
We really would welcome your thoughts, suggestions, recommendations and feedback.
We’re glad that you loved our service. We are always trying our best to make your real estate experience better.
Share your thoughts here: https://g.page/r/CUOeFzxOj8z-EAg/review
Call for free real estate consultation: 82877 42630
0 notes
Text
Tumblr media
We really would welcome your thoughts, suggestions, recommendations and feedback.
We’re glad that you loved our service. We are always trying our best to make your real estate experience better.
Share your thoughts here: https://g.page/r/CUOeFzxOj8z-EAg/review
Call for free real estate consultation: 82877 42630
0 notes
Text
Tumblr media
We really would welcome your thoughts, suggestions, recommendations and feedback.
We’re glad that you loved our service. We are always trying our best to make your real estate experience better.
Share your thoughts here: https://g.page/r/CUOeFzxOj8z-EAg/review
Call for free real estate consultation: 82877 42630
1 note · View note
Text
Follow @propkeysconsulting for latest real estate news and updates
Connect now for free real estate consultation: 8287742630
1 note · View note
propkey-blog · 8 years
Text
Trend of Real Estate Portal in Hyderabad, India
With so many ups and downs happening in all the sectors because of global economic go-slow, investments in Indian real estate especially in Hyderabad, Chennai, and Bangalore are the hottest topic for discussion. This stage of the slowdown is also perceiving mass development in real estate sector. Everyone is affected by one of the aspects of selling, buying or renting a property. Seemingly, abruptly changes the behavior of consumers and financial firms can be seen with the changing trends in first-time.
Each person is normally involved in property related issues of investing, selling or leasing. Since it makes difficult to take these decisions and there is some amount of risk involved, we mostly depend on real estate property brokers and the predominant word of mouth. These tendencies are now facing a makeover with the ever-growing internet diffusion and the constantly increasing internet users. With user, base exceeding over 50 million, online property portals create a revolutionize in the real estate sector.
Real Estate in Hyderabad, creates a revolutionary in developing places like Gachibowli, Kukatpally, Hitech city and out skirted areas creates a trend and branding of real estate market. Just in less time the cost of land raises people’s expectations and booming gradually increases. Real estate and construction companies come forward to build a lot of apartments, villas, and houses with proximity to customer specifications.
In that way Lodha Bellezza, Lodha Meridian projects located in Kukatpally. In the same way, Ramky Estates also started Ramky one Galaxia, One Marvel so many upcoming projects are also under construction In Hyderabad. Especially Lodha Bellezza sky villas and Lodha Meridian Kukatpally projects are will become one of the best projects in Hyderabad.
Real estate portal is a stage for the trade of data pertinent to property. They show private and business property postings; purchasing, offering and leasing choices; different suggestions for property enrolments, property advances, property laws, property news, and so forth. This recently creating pattern of entrances has made the web a worthy and in addition compelling medium for land exchanges. Both property vendors and property purchasers locate this medium profoundly financially savvy, engaging and to a great degree accommodating.
·         For land dealers, i.e. the supply side Internet is valuable in more than one way. It can be noted as taking after;
·         Promoting on web permits more illustrative advertisements as against space confined print advertisements.
·         It empowers bring down expenses when contrasted with different methods of promotions.
·         It offers different extra components like a virtual stroll through, transferring video cuts, online databases, chronicles of postings, and so on.
·         Web is the most intelligent method for publicizing as it associates the merchants with the potential purchasers through talk envoys, and so forth.
·         The land purchasers i.e. the individuals who remain on the request side of           property likewise discover web a possible method for searching for a property because:
Ø  It is advantageous and efficient to look for accessible property online than going by land specialists and sitting tight for their reaction.
Ø  Entrances decrease reliability on outsiders as all the data and posting are accessible on the web.
Ø  There is no confinement to a number of properties accessible as property specialists are for the most part well known inside a specific zone.
Ø  The hunt and correlation between properties as per regions, and so on has turned out to be easy as entries are doing that as well.
Ø  Purchasers can soon make online exchanges, see highlighted exhibitions and stroll through empty properties.
The present circumstances witness occupants and landowners connecting in a cutting-edge way. The ideas of mechanized exchanges and keen structures is picking up prevalence on this front. Flat proprietors and business developers welcome mechanized lease installments, putting in of work request demands on the web, show of offices administration, and so forth.
Making a framework that mixes blocks and snaps are instrumental in changing the substance of Indian land area. Web network and meeting of purchasers and merchants online just further enthuses the property advertise.
In my opinion In Andhra Pradesh and Telangana regions, real estate portal will impact the global economy of both states. In Amaravathi and Real Estate in Vijayawada, the cost of Land suddenly raised and in Hyderabad some slowdown in real estate Market so be careful while spending your worthful money it’s better to go Lodha Bellezza Hyderabad and live happily with your family members.
0 notes
propkey-blog · 8 years
Photo
Tumblr media
Ramky estates another project Ramky One Galaxia, Nallagandla, Near Gachibowli, Hyderabad. Ramky One Galaxia, A Premium 3 BHK Residential Gated Community apartment with World Class Facilities & Amenities. For More @ http://ramkyonegalaxia.propkey.co.in
0 notes